msync need not be applied to the entire mmap
Plebeia context is append only, except the header part. Therefore the modifications are always:
- At the end of the context file
- Or the header
Currently its msync() call is done against the whole mmap.
If we do not msync() all the area but only the modified parts, then it can finish the process faster.
See the kernel code https://elixir.bootlin.com/linux/latest/source/mm/msync.c which seems to traverse the specified area of mmap.
-
Record the modified area since the last msync() -
Modify msync OCaml function to call msync() not for the entire mmap but for the specfied area. -
Change the code only to msync the modified part -
Benchmark
Edited by Jun Furuse