4 ms·
The page states that CRIU requires kernel patches, but other sources say that the kernel code for CRIU is already in the mainline kernel. What's up with that?
by zozbot234 7y ago
The page states that CRIU requires kernel patches, but other sources say that the kernel code for CRIU is already in the mainline kernel. What's up with that?
- trishume 7y agoI didn't say it requires kernel patches, just that it requires a build flag and new enough versions. It does happen that most distros do enable that build flag though. There is a patch set for write protection support in userfaultfd that was just merged recently and I'm not sure if it's made it into any actual releases yet.
- cyphar 7y agoCRIU does work on mainline kernels and has for several years. However, it is still being actively developed (userfaultfd is the example the article uses -- a mainline feature which is still seeing lots of development). It doesn't usually require additional patches to work, though they do have a fairly big job (every new kernel feature needs to be added to CRIU so it can both checkpoint and restore it -- and not all features are trivial to checkpoint). It's entirely possible that programs using very new kernel features may struggle to get CRIU to work.
- en4bz 7y agoCRIU can use two mechanisms to detect page changes. One is the soft-dirty kernel feature which is mainlined and can be accessed via /proc/PID/pagemap [1]. The other is userfaultfd which is only partially merged in the newest kernel. userfaultfd lacks write detection which the article mentioned. My understanding is that using pagemap requires the entire process to be frozen while it is scanned for memory changes and the memory is copied while uffd allows for a more streaming/on-demand approach that doesn't require stopping the entire process. [1] https://www.kernel.org/doc/Documentation/vm/soft-dirty.txt https://www.kernel.org/doc/Documentation/vm/soft-dirty.txt