• Cyrill Gorcunov's avatar
    retore: Fix up shared anonymous memory restore procedure · 5d5e8b80
    Cyrill Gorcunov authored
    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: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
    5d5e8b80
Name
Last commit
Last update
include Loading commit data...
test Loading commit data...
.gitignore Loading commit data...
COPYING Loading commit data...
Makefile Loading commit data...
README Loading commit data...
TODO Loading commit data...
cr-dump.c Loading commit data...
cr-restore.c Loading commit data...
cr-show.c Loading commit data...
crtools.c Loading commit data...
gen-offsets.sh Loading commit data...
libnetlink.c Loading commit data...
log.c Loading commit data...
parasite-syscall.c Loading commit data...
parasite.c Loading commit data...
parasite.lds.S Loading commit data...
ptrace.c Loading commit data...
restorer.c Loading commit data...
sockets.c Loading commit data...
util.c Loading commit data...