Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755088AbYGAKvy (ORCPT ); Tue, 1 Jul 2008 06:51:54 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752627AbYGAKvn (ORCPT ); Tue, 1 Jul 2008 06:51:43 -0400 Received: from E23SMTP03.au.ibm.com ([202.81.18.172]:38563 "EHLO e23smtp03.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754139AbYGAKvm (ORCPT ); Tue, 1 Jul 2008 06:51:42 -0400 Date: Tue, 1 Jul 2008 16:21:26 +0530 From: Dhaval Giani To: Li Zefan Cc: Paul Menage , Andrew Morton , Balbir Singh , Sudhir Kumar , lkml , containers@lists.osdl.org, Paul Jackson Subject: Re: Attaching PID 0 to a cgroup Message-ID: <20080701105126.GA10403@linux.vnet.ibm.com> Reply-To: Dhaval Giani References: <20080701094545.GD3925@linux.vnet.ibm.com> <20080701094734.GE3925@linux.vnet.ibm.com> <486A06B7.7020906@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <486A06B7.7020906@cn.fujitsu.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: 1830 Lines: 70 On Tue, Jul 01, 2008 at 06:28:07PM +0800, Li Zefan wrote: > CC: Paul Jackson > > Dhaval Giani wrote: > > [put in the wrong alias for containers list correcting it.] > > > > On Tue, Jul 01, 2008 at 03:15:45PM +0530, Dhaval Giani wrote: > >> Hi Paul, > >> > >> Attaching PID 0 to a cgroup caused the current task to be attached to > >> the cgroup. Looking at the code, > >> > > [...] > > >> > >> I was wondering, why this was done. It seems to be unexpected behavior. > >> Wouldn't something like the following be a better response? (I've used > >> EINVAL, but I can change it to ESRCH if that is better.) > >> > > Why is it unexpected? it follows the behavior of cpuset, so this patch will > break backward compatibility of cpuset. Ah, I was not aware of that. Thanks! > > But it's better to document this. > Yes please. > ----------------------------------------- > > Document the following cgroup usage: > # echo 0 > /dev/cgroup/tasks > > Signed-off-by: Li Zefan Acked-by: Dhaval Giani > --- > cgroups.txt | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/Documentation/cgroups.txt b/Documentation/cgroups.txt > index 824fc02..213f533 100644 > --- a/Documentation/cgroups.txt > +++ b/Documentation/cgroups.txt > @@ -390,6 +390,10 @@ If you have several tasks to attach, you have to do it one after another: > ... > # /bin/echo PIDn > tasks > > +You can attach the current task by echoing 0: > + > +# /bin/echo 0 > tasks > + > 3. Kernel API > ============= > > -- regards, Dhaval -- 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/