Pre-dumping is the process of capturing dirty memory pages while an application continues to run, aiming to minimize the final “freeze time” during live migration. CRIU provides two primary modes for pre-dumping: read and splice.
read Mode (Traditional)In this mode, CRIU uses the process_vm_readv system call to read memory from the target process.
process_vm_readv requires the target process to be alive and its memory mappings to remain stable during the read.splice Mode (Optimized & Default)The splice mode (enabled via --pre-dump-mode=splice) uses a zero-copy “gift” mechanism to further reduce freeze time and improve reliability.
splice Mode Works:vmsplice() with the SPLICE_F_GIFT flag. This flag tells the kernel that the process is “giving” these pages to a pipe.vmsplice() calls are complete (which is extremely fast as no data is actually copied), the parasite is removed, and the tasks are resumed immediately.splice is Better:vmsplice() system calls, rather than the time needed to transfer memory data over the network or to disk. This scheme relies entirely on vmsplice() being extremely fast. Because the target process is frozen during these calls, minimizing this duration is critical to the primary goal of pre-dumping: reducing process downtime during live migration and making the migration process almost invisible to the application.splice mode avoids copying memory to CRIU user-space buffers (unlike read mode which uses process_vm_readv to copy data). While this zero-copy mechanism does not use COW (meaning intermediate dumps can be inconsistent if pages are modified after resume), CRIU’s iterative design handles this inconsistency (see below) while maximizing transfer performance.Because the target process is resumed while CRIU is still writing the memory data (in both read and splice modes), intermediate pre-dump images may contain inconsistent memory states.
This inconsistency is expected and handled by CRIU’s iterative design:
The optimized splice mode is the default in modern CRIU. It can be explicitly requested using the --pre-dump-mode option:
criu pre-dump --pre-dump-mode splice ...