Changes

Jump to navigation Jump to search
m
Line 78: Line 78:  
Current [[CLI/cmd/pre-dump|pre-dump]] mode is used to write task memory contents into image
 
Current [[CLI/cmd/pre-dump|pre-dump]] mode is used to write task memory contents into image
 
files w/o stopping the task for too long. It does this by stopping the task, infecting it and
 
files w/o stopping the task for too long. It does this by stopping the task, infecting it and
draining all the memory into a set of pipes. Then the task is cured and resumed and the pipes'
+
draining all the memory into a set of pipes. Then the task is cured, resumed and the pipes'
contents is written into images (maybe a [[page server]]). This approach creates a big stress
+
contents is written into images (maybe a [[page server]]). Unfortunately, this approach creates
on memory subsystem, as keeping all the memory in pipes creates a lot of unreclaimable memory
+
a big stress on the memory subsystem, as keeping all memory in pipes creates a lot of unreclaimable
(pages in pipes are not swappable), as well as the number of pipes themselves can be buge (as
+
memory (pages in pipes are not swappable), as well as the number of pipes themselves can be huge, as
one pipe doesn't store more than a fixed certain amount of data).
+
one pipe doesn't store more than a fixed amount of data (see pipe(7) man page).
   −
We can try to use sys_read_process_vm() syscall to mitigate all of the above. To do this we
+
A solution for this problem is to use a sys_read_process_vm() syscall, which will mitigate
need to allocate a temporary buffer in criu, then walk the target process vm by copying the
+
all of the above. To do this we need to allocate a temporary buffer in criu, then walk the
memory piece-by-piece into it, then flush the data into image (or page server), then repeat.
+
target process vm by copying the memory piece-by-piece into it, then flush the data into image
 +
(or page server), and repeat.
    
Ideally there should be sys_splice_process_vm() syscall in the kernel, that does the same as
 
Ideally there should be sys_splice_process_vm() syscall in the kernel, that does the same as
332

edits

Navigation menu