• Adrian Reber's avatar
    lazy-pages: add support to combine pre-copy and post-copy · e3fb9bd9
    Adrian Reber authored
    Only the UFFD daemon is aware if pages are in the parent or not. The
    restore will continue to work as any lazy-restore except that pages from
    parent checkpoints will be pre-populated by the restorer.
    
    The restorer will still register the whole memory region as being
    handled by userfaultfd even if it contains pages from parent
    checkpoints. Userfaultfd page faults will only happen on pages which
    contain no data. This means from the parent pre-populated pages will not
    trigger a userfaultfd message even if marked as being handled by
    userfaultfd.
    
    The UFFD daemon knows about pages which are available in the parent
    checkpoints and will not push those pages unnecessarily to userfaultfd.
    
    Following steps to migrate a process are now possible:
    
    Source system:
    
     * criu pre-dump -D /tmp/cp/1 -t <PID>
     * rsync -a /tmp/cp <destination>:/tmp
     * criu dump -D /tmp/cp/2 -t <PID> --port 27 --lazy-pages \
       --prev-images-dir ../1/ --track-mem
    
    Destination system:
    
     * rsync -a <source>:/tmp/cp /tmp/
     * criu lazy-pages --page-server --address <source> --port 27 \
       -D /tmp/cp/2 &
     * criu restore --lazy-pages -D /tmp/cp/2
    
    This will now restore all pages from the parent checkpoint if they
    are not marked as lazy in the second checkpoint.
    
    v2:
     - changed parent detection to use pagemap_in_parent()
    
    v3:
     - unfortunately this reverts
       c11cf95afbe023a2816a3afaecb65cc4fee670d7
       "criu: mem: skip lazy pages during restore based on pagemap info"
       To be able to split the VMA-s in the right chunks for the restorer
       it is necessary to make the decision lazy or not on the VmaEntry
       level.
    
    v4:
     - everything has changed thanks to Mike Rapoport's suggestion
     - the VMA-s are no longer touched or split
     - instead of over 100 lines of changes this is now two line patch
    Signed-off-by: 's avatarAdrian Reber <areber@redhat.com>
    Acked-by: 's avatarMike Rapoprot <rppt@linux.vnet.ibm.com>
    Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
    e3fb9bd9
Name
Last commit
Last update
Documentation Loading commit data...
compel Loading commit data...
contrib Loading commit data...
coredump Loading commit data...
crit Loading commit data...
criu Loading commit data...
images Loading commit data...
include/common Loading commit data...
lib Loading commit data...
scripts Loading commit data...
soccr Loading commit data...
test Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
.travis.yml Loading commit data...
COPYING Loading commit data...
CREDITS Loading commit data...
INSTALL.md Loading commit data...
Makefile Loading commit data...
Makefile.compel Loading commit data...
Makefile.config Loading commit data...
Makefile.install Loading commit data...
Makefile.versions Loading commit data...
README.md Loading commit data...