lkml.org 
[lkml]   [2010]   [Mar]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] linux-cr: nested pid namespaces (v3)
Quoting Louis Rilling (Louis.Rilling@kerlabs.com):
> On Tue, Mar 23, 2010 at 12:18:39AM -0500, Serge E. Hallyn wrote:
> > Support checkpoint and restart of tasks in nested pid namespaces.
> > We keep the original single pids_array to minimize memory
> > allocations. The pids array entries are augmented with a pidns
> > depth (relative to the container init's pidns, and an "rpid" which
> > is the pid in the checkpointer's pidns (or 0 if no valid pid exists).
> > The rpid will be used by userspace to gather more information (like
> > /proc/$$/mountinfo) after the kernel sys_checkpoint. If any tasks
> > are in nested pid namespace, another single array will hold all of
> > the vpids. At restart those are used by userspace to determine how
> > to call eclone(). Kernel ignores them.
> >
> > This patch also adds 'rpid' to struct ckpt_hdr_pids, which is not
> > needed for nested pid_ns support, but will be needed for the
> > userspace checkpointer to gather additional information (i.e.
> > /proc/pid/mountinfo) after sys_checkpoint() completes.
> >
> > Changelog:
> > Mar 22:
> > Use Louis Rilling's smarter ckpt_vpids algorithm
> > verbatim, to handle pid_ns depths > CKPT_HDR_PIDS_CHUNK,
> > as well as fix an apparent bug in my original code.
> >
> > As Louis suggested, use task_active_pid_ns() rather than
> > task->nsproxy->pid_ns. In fact it's a must, bc the
> > checkpointed task may be dead and have NULL
> > task->nsproxy->pid_ns.
>
> Hm, if task can be dead, then there is a much bigger issue:
> task->nsproxy is NULL. Or did I miss something?

Well, it's a zombie - checkpoint/checkpoint.c:may_checkpoint_task()
explicitly ignores nsproxy tests for zombies (but returns -EBUSY
for exit_state == EXIT_DEAD). So yeah, nsproxy is NULL, which is
why I have to use task_active_pid_ns() :)

-serge


\
 
 \ /
  Last update: 2010-03-23 15:49    [W:0.049 / U:4.332 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site