• Kir Kolyshkin's avatar
    open_proc() and friends: hide pid_dir · 447388d7
    Kir Kolyshkin authored
    This patch tries to introduce lazy and hidden pid_dir support,
    meaning one don't have to worry about pid_dir but the optimization
    is still there.
    
    The patch relies on the fact that we work with many /proc/pid files for
    one pid, then for another pid and so on, i.e. not in a random manner.
    
    The idea is when we call open_proc() with a new pid for the first time,
    the appropriate /proc/PID directory is opened and its fd is stored.
    Next call to open_proc() with the same PID only need to check that
    the PID is not changed. In case PID is changed, we close the old one
    and open/store a new one.
    
    Now the code using open_proc() and friends:
    - does not need to carry proc_pid around, pid is enough
    - does not need to call open_pid_proc()
    
    The only thing that can't be done in that "lazy" mode is closing the last
    PID fd, thus close_pid_proc().
    Signed-off-by: 's avatarKir Kolyshkin <kir@openvz.org>
    Acked-by: 's avatarPavel Emelyanov <xemul@parallels.com>
    Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
    447388d7
Name
Last commit
Last update
Documentation Loading commit data...
include Loading commit data...
test Loading commit data...
tools Loading commit data...
.gitignore Loading commit data...
COPYING Loading commit data...
Makefile Loading commit data...
Makefile.inc Loading commit data...
README 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...
ipc_ns.c Loading commit data...
libnetlink.c Loading commit data...
log.c Loading commit data...
namespaces.c Loading commit data...
parasite-syscall.c Loading commit data...
parasite.c Loading commit data...
parasite.lds.S Loading commit data...
proc_parse.c Loading commit data...
ptrace.c Loading commit data...
restorer-log.c Loading commit data...
restorer.c Loading commit data...
restorer.lds.S Loading commit data...
sockets.c Loading commit data...
sysctl.c Loading commit data...
util-net.c Loading commit data...
util.c Loading commit data...
uts_ns.c Loading commit data...