Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757124Ab0FTU32 (ORCPT ); Sun, 20 Jun 2010 16:29:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43320 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757078Ab0FTU30 (ORCPT ); Sun, 20 Jun 2010 16:29:26 -0400 Date: Sun, 20 Jun 2010 22:27:36 +0200 From: Oleg Nesterov To: "Eric W. Biederman" Cc: Andrew Morton , Louis Rilling , Pavel Emelyanov , Linux Containers , linux-kernel@vger.kernel.org, Daniel Lezcano , Roland McGrath Subject: Re: [PATCH 1/6] pid: Remove the child_reaper special case in init/main.c Message-ID: <20100620202736.GB6902@redhat.com> References: <20100618082033.GD16877@hawkmoon.kerlabs.com> <20100618111554.GA3252@redhat.com> <20100618160849.GA7404@redhat.com> <20100618173320.GG16877@hawkmoon.kerlabs.com> <20100618175541.GA13680@redhat.com> <20100618212355.GA29478@redhat.com> <20100619190840.GA3424@redhat.com> <20100620182948.GB3258@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100620182948.GB3258@redhat.com> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1819 Lines: 47 On 06/20, Oleg Nesterov wrote: > > On 06/20, Eric W. Biederman wrote: > > > > --- a/kernel/fork.c > > +++ b/kernel/fork.c > > @@ -1263,7 +1263,7 @@ static struct task_struct *copy_process(unsigned long clone_flags, > > tracehook_finish_clone(p, clone_flags, trace); > > > > if (thread_group_leader(p)) { > > - if (clone_flags & CLONE_NEWPID) > > + if (pid->numbers[pid->level].nr == 1) > > p->nsproxy->pid_ns->child_reaper = p; > > I must admit, personally I dislike this change. If it is needed for > the next changes, please explain the need? > > Yes, it removes the line from __init function, but it complicates > copy_process(), this doesn't look fair to me ;) I agree, the complication > is minor, but still. And, in fact, to me this change hides CLONE_NEWPID > from grep. > > In fact, I was looking at this code when I did 1/4. And I think it is > better to move it (and perhaps another CLONE_NEWPID check in copy_signal) > into copy_pid_ns() path. OK, this is needed for 6/6. I still can't say I like this change (and 6/6 too ;), and it is not enough. If we spawn the new init because we called sys_unshare(CLONE_NEWPID) in the past (Eric, imho this can't be the really nice idea) we should also set TASK_UNKILLABLE at least. IOW. Not only this hides CLONE_NEWPID from grep, unshare() also hides it from paths which should know about this flag. I'd rather prefer the straightforward implementation of unshare(NEWPID) which merely adds SIGNAL_THE_NEXT_FORK_SHOULD_USE_CLONE_NEWPID flag to current->signal->flags. Yes, this is very ugly too. Oleg. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/