criu icon indicating copy to clipboard operation
criu copied to clipboard

Pre-dump produces too big memory overhead

Open xemul opened this issue 8 years ago • 7 comments

Current pre-dump mode suffers from several issues

  1. It keeps all the memory in pipes, and their number can be huge due to limited one pipe size
  2. It keeps all the memory in pipes and this memory is unreclaimable for that period
  3. It infects tasks to drain memory from

We can try to use sys_read_process_vm() syscall to mitigate all of the above

  1. No pipes, just copy data into temp buffer and send
  2. Memory is always reclaimable
  3. No infection is needed, just freeze, reset the tracker and proceed

Ideally there should be sys_splice_process_vm() syscall in the kernel :)

xemul avatar Jul 04 '17 15:07 xemul

Here is a prototype https://github.com/avagin/criu/tree/process_vm_readv

avagin avatar Aug 05 '17 23:08 avagin

If we use sys_read_process_vm(), we can't dump memory which are not accessible to read. Currently we call add PROT_READ by mprotect(), add pages into pipes, and restore vma_prot.

avagin avatar Aug 05 '17 23:08 avagin

Here is a draft version of sys_process_vmsplice: https://github.com/avagin/linux-task-diag/commits/process_vmsplice

avagin avatar Aug 07 '17 06:08 avagin

As this was completed by Abhishek in GSoC 2019, should we close this issue?

rst0git avatar Jan 19 '20 20:01 rst0git

A friendly reminder that this issue had no activity for 30 days.

github-actions[bot] avatar Jan 20 '21 00:01 github-actions[bot]

A friendly reminder that this issue had no activity for 30 days.

github-actions[bot] avatar Feb 26 '21 00:02 github-actions[bot]

A friendly reminder that this issue had no activity for 30 days.

github-actions[bot] avatar Apr 03 '21 00:04 github-actions[bot]