criu/include
Cyrill Gorcunov 5d5e8b801c retore: Fix up shared anonymous memory restore procedure
Restorer does really restore shared memory (including page
contents restore) only on master process, while all other
processes do open such memory area via map_files/ procfs entry
so that we might have a situation when shared VMA is present
in some particular core-%d.img file but it's not listed in
collected shmems array and find_shmem_by_pid will return NULL.
This is perfectly fine, be ready for that.

Another issue is that shared memory might look like

CR_FD_SHMEM: /home/cyrill/projects/kernel/crtools/shmem-2641.img
----------------------------------------
0x7f2200775000-0x7f2200776000 id 19664
0x7f2200776000-0x7f2200777000 id 19663
----------------------------------------

So vma area is [x;y) range and we should distinguish two
shmem lookup cases

 - one when we search for page in shmem area
 - second when we lookup shmem area in collected ranges

They both have a different lookup conditions so single
find_shmem splitted into two helpers find_shmem and
find_shmem_page as appropriate.

This patch finally fixes the three process asynchronious
shared memory updates test-case.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-01-04 18:31:48 +04:00
..
atomic.h Gather futex helpers into lock.h 2011-12-26 23:54:18 +04:00
bitops.h restore: Add mutexes via futex syscall and order threads creation 2011-11-18 16:09:01 +04:00
compiler.h Add ALIGN helper 2011-11-16 18:16:12 +04:00
crtools.h crtools: Cleanup open_image_ro 2011-12-29 19:56:34 +04:00
image.h Unix sockets initial support 2011-12-26 23:25:04 +04:00
libnetlink.h net: Define named constant for nlmsg_seq 2011-12-27 20:13:18 +04:00
list.h Initial commit 2011-09-23 12:00:45 +04:00
lock.h lock: Add cr_wait_init helper 2012-01-04 16:40:13 +04:00
log.h Move logging functions to log.c 2011-12-19 18:52:50 +04:00
parasite-syscall.h Add missing extern to function prototypes 2011-12-19 21:46:03 +04:00
parasite.h parasite: Make max size for path being PATH_MAX 2011-12-19 15:34:37 +04:00
ptrace.h dump: Drop unneeded #includes 2011-12-19 23:18:17 +04:00
restorer.h retore: Fix up shared anonymous memory restore procedure 2012-01-04 18:31:48 +04:00
sockets.h net: A few changes in headres to follow c99 2011-12-27 14:26:13 +04:00
syscall-codes.h syscalls: Add sys_msync helper 2012-01-04 16:40:35 +04:00
syscall.h syscalls: Add sys_msync helper 2012-01-04 16:40:35 +04:00
types.h dump: Drop unneeded #includes 2011-12-19 23:18:17 +04:00
unix_diag.h net: A few changes in headres to follow c99 2011-12-27 14:26:13 +04:00
util.h make: Add DEBUG=1 option 2011-12-27 02:28:12 +04:00