• Andrey Vagin's avatar
    restore: Learn to work with shared struct file-s · d6a1cd0f
    Andrey Vagin authored
    Some process can share one struct file-s, we may find them by "object IDs".
    A file descriptor is opened in one process and send to other via unix socket.
    
    The procedure of restoring files contains four stages.
    * Collect data about all file's descriptors
      On this stage we find process which will restore a file descriptor and
      create a list of processes, who should get this descriptor.
    
    * Create datagrams unix sockets
      If a file descriptor should be received, a unix socket is created
      instead of it.
    
    * Open file descriptors
      A process with the least pid opens a file and sends this file
      descriptors to all one who wait it.
    
    * Receive file descriptors.
    
    When we were thinking up this algoritm, we wanted to minimize a number
    of context switches. A number of context switches is proportional of a
    number of processes.
    Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
    Acked-by: 's avatarPavel Emelyanov <xemul@parallels.com>
    Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
    d6a1cd0f
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...
files.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...