[1] https://github.com/qemu/qemu/blob/7dd9d7e0bd29abf590d1ac235c...
[1] https://github.com/qemu/qemu/blob/7dd9d7e0bd29abf590d1ac235c...
In our case we changed Firecracker to use a shared mmap instead of an private mmap, so in our case the dirtied pages were synced back automatically to the backing memory file. The main reason for this was to reduce IO on snapshot time. I'm also looking at other ways we can do this, because using a shared mmap fragments the underlying xfs fs pretty fast. Maybe we can batch writes more instead of writing single pages.
Using XFS with CoW has been the easiest way to enable this, but if there's a way that we can do this purely in-memory, that would be even faster.
That said, for hibernation we would still have to persist to disk, but timing is less important there.
https://github.com/firecracker-microvm/firecracker/blob/main...