From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Brauner Subject: Re: [PATCH v2 2/3] clone3: allow spawning processes into cgroups Date: Wed, 8 Jan 2020 19:10:49 +0100 Message-ID: <20200108181049.ysmo73celrt4bvo2@wittgenstein> References: <20191223061504.28716-1-christian.brauner@ubuntu.com> <20191223061504.28716-3-christian.brauner@ubuntu.com> <20200108160102.GA17415@blackbody.suse.cz> Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline In-Reply-To: <20200108160102.GA17415@blackbody.suse.cz> Sender: linux-kernel-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="iso-8859-1" To: Michal =?utf-8?Q?Koutn=C3=BD?= Cc: linux-api@vger.kernel.org, linux-kernel@vger.kernel.org, Tejun Heo , Ingo Molnar , Oleg Nesterov , Johannes Weiner , Li Zefan , Peter Zijlstra , cgroups@vger.kernel.org On Wed, Jan 08, 2020 at 05:01:02PM +0100, Michal Koutn=C3=BD wrote: > On Mon, Dec 23, 2019 at 07:15:03AM +0100, Christian Brauner wrote: > > This adds support for creating a process in a different cgroup than its > > parent. > Binding fork and migration together looks useful. >=20 > > --- a/kernel/cgroup/cgroup.c > > +++ b/kernel/cgroup/cgroup.c > > @@ -5882,21 +5882,176 @@ void cgroup_fork(struct task_struct *child) > > INIT_LIST_HEAD(&child->cg_list); > Just a nitpick, I noticed the comment for cgroup_fork should be updated > too (generic migration happens in cgroup_post_fork). Thanks. >=20 > > --- a/kernel/fork.c > > +++ b/kernel/fork.c > > [...] > > @@ -2279,8 +2278,7 @@ static __latent_entropy struct task_struct *copy_= process( > > write_unlock_irq(&tasklist_lock); > > =20 > > proc_fork_connector(p); > > - cgroup_post_fork(p); > > - cgroup_threadgroup_change_end(current); > > + cgroup_post_fork(current, p, args); > I can see that when CLONE_INTO_CGROUP | CLONE_NEWCGROUP is passed, then > the child's cgroup NS will be rooted at parent's css set > (copy_namespaces precedes cgroup_post_fork). >=20 > Wouldn't it make better sense if this flags combination resulted in > child's NS rooted in its css set? I need to take a closer look but it sounds like we should move the copying of the cgroup namespace to a later point; but again I need to look into this. Thanks! Christian