[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20120508155116.d5a34e11.akpm@linux-foundation.org>
Date: Tue, 8 May 2012 15:51:16 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: ebiederm@...ssion.com (Eric W. Biederman)
Cc: Oleg Nesterov <oleg@...hat.com>,
LKML <linux-kernel@...r.kernel.org>,
Pavel Emelyanov <xemul@...allels.com>,
Cyrill Gorcunov <gorcunov@...nvz.org>,
Louis Rilling <louis.rilling@...labs.com>,
Mike Galbraith <efault@....de>
Subject: Re: [PATCH 3/3] pidns: Make killed children autoreap
On Sun, 06 May 2012 17:35:46 -0700
ebiederm@...ssion.com (Eric W. Biederman) wrote:
>
> Force SIGCHLD handling to SIG_IGN so that signals are not generated
> and so that the children autoreap. This increases the parallelize
> and in general the speed of network namespace shutdown.
>
> Note self reaping childrean can exist past zap_pid_ns_processess but
> they will all be reaped before we allow the pid namespace init task
> with pid == 1 to be reaped.
>
> Signed-off-by: Eric W. Biederman <ebiederm@...ssion.com>
> ---
> kernel/pid_namespace.c | 7 ++++++-
> 1 files changed, 6 insertions(+), 1 deletions(-)
>
> diff --git a/kernel/pid_namespace.c b/kernel/pid_namespace.c
> index 57bc1fd..b98b0ed 100644
> --- a/kernel/pid_namespace.c
> +++ b/kernel/pid_namespace.c
> @@ -149,7 +149,12 @@ void zap_pid_ns_processes(struct pid_namespace *pid_ns)
> {
> int nr;
> int rc;
> - struct task_struct *task;
> + struct task_struct *task, *me = current;
> +
> + /* Ignore SIGCHLD causing any terminated children to autoreap */
> + spin_lock_irq(&me->sighand->siglock);
> + me->sighand->action[SIGCHLD -1].sa.sa_handler = SIG_IGN;
> + spin_unlock_irq(&me->sighand->siglock);
Taking a lock around a single atomic write is always fishy. What
exactly is this locking here for?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists