[CRIU] [PATCH cr 5/6] mm: rework of dumping shared memory

Andrey Vagin avagin at openvz.org
Wed Mar 21 02:12:01 EDT 2012


vma_entry contains shmid and all shared memory are dumped in own files.
The most interesting thing is restore.
A maping is restored by process with the smallest pid. The mamping
is created before executing restorer.
We map a full mapping and restore it's conten, then we open a file from
/proc/pid/map_files and store a descriptor in vma_info. The mapping is
unmaped. Now we can map any region of this mapping in the restorer.

We use this trick, because a target process may have this mapping in
some places and the restorer has not function to open proc files.

v2: fix error hangling

Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 cr-dump.c          |  142 +++++++++++++++++++++--
 cr-restore.c       |  329 +++++++++++++++++++++++-----------------------------
 cr-show.c          |   24 ----
 crtools.c          |    6 -
 include/crtools.h  |    9 +-
 include/image.h    |    7 -
 include/restorer.h |   18 ++-
 parasite-syscall.c |   16 +--
 parasite.c         |    7 -
 restorer.c         |    8 +-
 util.c             |    5 +-
 11 files changed, 306 insertions(+), 265 deletions(-)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005-mm-rework-of-dumping-shared-memory.patch
Type: text/x-patch
Size: 23597 bytes
Desc: not available
Url : http://openvz.org/pipermail/criu/attachments/20120321/5a630226/0005-mm-rework-of-dumping-shared-memory-0001.bin


More information about the CRIU mailing list