From: Christian Brauner <christian.brauner@ubuntu.com>
To: "Michal Koutný" <mkoutny@suse.com>
Cc: linux-api@vger.kernel.org, linux-kernel@vger.kernel.org,
Tejun Heo <tj@kernel.org>, Ingo Molnar <mingo@redhat.com>,
Oleg Nesterov <oleg@redhat.com>,
Johannes Weiner <hannes@cmpxchg.org>,
Li Zefan <lizefan@huawei.com>,
Peter Zijlstra <peterz@infradead.org>,
cgroups@vger.kernel.org
Subject: Re: [PATCH v2 2/3] clone3: allow spawning processes into cgroups
Date: Wed, 8 Jan 2020 19:10:49 +0100 [thread overview]
Message-ID: <20200108181049.ysmo73celrt4bvo2@wittgenstein> (raw)
In-Reply-To: <20200108160102.GA17415@blackbody.suse.cz>
On Wed, Jan 08, 2020 at 05:01:02PM +0100, Michal Koutný wrote:
> On Mon, Dec 23, 2019 at 07:15:03AM +0100, Christian Brauner <christian.brauner@ubuntu.com> wrote:
> > This adds support for creating a process in a different cgroup than its
> > parent.
> Binding fork and migration together looks useful.
>
> > --- 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.
>
> > --- 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);
> >
> > 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).
>
> 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
next prev parent reply other threads:[~2020-01-08 18:10 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20191223061504.28716-1-christian.brauner@ubuntu.com>
2019-12-23 6:15 ` [PATCH v2 1/3] cgroup: unify attach permission checking Christian Brauner
2019-12-23 6:15 ` [PATCH v2 2/3] clone3: allow spawning processes into cgroups Christian Brauner
2020-01-07 16:32 ` Tejun Heo
2020-01-08 18:09 ` Christian Brauner
2020-01-16 12:29 ` Christian Brauner
2020-01-17 16:53 ` Tejun Heo
[not found] ` <20200117165311.GH2677547-LpCCV3molIbIZ9tKgghJQw2O0Ztt9esIQQ4Iyu8u01E@public.gmane.org>
2020-01-17 17:12 ` Christian Brauner
2020-01-08 16:01 ` Michal Koutný
2020-01-08 18:10 ` Christian Brauner [this message]
2020-01-16 23:57 ` Christian Brauner
2019-12-23 6:15 ` [PATCH v2 3/3] selftests/cgroup: add tests for cloning " Christian Brauner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200108181049.ysmo73celrt4bvo2@wittgenstein \
--to=christian.brauner@ubuntu.com \
--cc=cgroups@vger.kernel.org \
--cc=hannes@cmpxchg.org \
--cc=linux-api@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lizefan@huawei.com \
--cc=mingo@redhat.com \
--cc=mkoutny@suse.com \
--cc=oleg@redhat.com \
--cc=peterz@infradead.org \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox