Changes

842 bytes added ,  12:01, 16 January 2019
Line 77: Line 77:  
=== Optimize the pre-dump algorithm ===
 
=== Optimize the pre-dump algorithm ===
 
   
 
   
'''Summary:''' Optimize the pre-dump algorithm to avoid vmsplice()-ing the whole memory
+
'''Summary:''' Optimize the pre-dump algorithm to avoid pinning to many memory in RAM
 
   
 
   
TODO: Detailed description of the project.
+
Current [[CLI/cmd/pre-dump|pre-dump]] mode suffers from several issues
 +
 
 +
* It keeps all the memory in pipes, and their number can be huge due to limited one pipe size
 +
* It keeps all the memory in pipes and this memory is unreclaimable for that period
 +
* It [[parasite code|stops and infects]] tasks to drain memory from
 +
 
 +
We can try to use sys_read_process_vm() syscall to mitigate all of the above. Benefits:
 +
 
 +
* No pipes, just copy data into temp buffer and send
 +
* Memory is always reclaimable
 +
* No infection is needed, just freeze, reset the tracker and proceed
 +
 
 +
Ideally there should be sys_splice_process_vm() syscall in the kernel, that does the same as
 +
the read_process_vm does, but vmsplices the data
 
   
 
   
 
'''Links:'''
 
'''Links:'''
 
* https://github.com/checkpoint-restore/criu/issues/351
 
* https://github.com/checkpoint-restore/criu/issues/351
* Wiki links to relevant material
+
* [[Memory dumping and restoring]], [[Memory changes tracking]]
* External links to mailing lists or web sites
+
* [http://man7.org/linux/man-pages/man2/process_vm_readv.2.html process_vm_readv(2)] [http://man7.org/linux/man-pages/man2/vmsplice.2.html vmsplice(2)] [https://lkml.org/lkml/2017/11/22/527 RFC for splice_process_vm syscall]
 
   
 
   
 
'''Details:'''
 
'''Details:'''
* Skill level: beginner or intermediate or advanced
+
* Skill level: intermediate
 
* Language: C
 
* Language: C
 
* Mentor: Pavel Emelianov <xemul@virtuozzo.com>
 
* Mentor: Pavel Emelianov <xemul@virtuozzo.com>
 
* Suggested by: Pavel Emelianov <xemul@virtuozzo.com>
 
* Suggested by: Pavel Emelianov <xemul@virtuozzo.com>
      
=== Anonymize image files ===
 
=== Anonymize image files ===