• Pavel Emelyanov's avatar
    restore: Relax the FORKING stage · 3bd08b77
    Pavel Emelyanov authored
    Here's why:
    
    This stage is needed to make sure all tasks have appeared
    and did some actions (that are called before restore_finish_stage()).
    With this description there's no need in involving criu process
    in it, this stage is purely inter-tasks sync point.
    
    Taking into account we do already make root task wait for others
    to complete forking (it calls restore_wait_ther_tasks()) we may
    rework this stage not to involve criu process in it.
    
    Here's how:
    
    So the criu task starts the forking stage, then goes waiting for
    "inprogress tasks". The latter wait is purely about nr_in_progress
    counter, thus there's no strict requirement that the stage remains
    the same by the time criu is woken up.
    
    Siad that, the root task waits for other tasks to finish forking,
    does fini_restore_mntns() (already in the code), then switches
    the stage to the next (the RESTORE one). Other tasks do normal
    staging barrier. Criu task is not woken up as nr_in_progress
    always remains >= 1.
    
    The result is -2 context switches -- from root task to criu and
    back -- which gives us good boost when restoring single task app.
    Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
    Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
    3bd08b77
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...