From: Peter Zijlstra <peterz@infradead.org>
To: Tejun Heo <tj@kernel.org>
Cc: Kirill Tkhai <tkhai@yandex.ru>,
Burke Libbey <burke.libbey@shopify.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"mingo@kernel.org" <mingo@kernel.org>
Subject: Re: [PATCH] sched: reset sched_entity depth on changing parent
Date: Mon, 27 Oct 2014 14:28:12 +0100 [thread overview]
Message-ID: <20141027132812.GG3337@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <20141027124002.GA4436@htj.dyndns.org>
On Mon, Oct 27, 2014 at 08:40:02AM -0400, Tejun Heo wrote:
> On Mon, Oct 27, 2014 at 01:07:34PM +0100, Peter Zijlstra wrote:
> > On Fri, Oct 24, 2014 at 09:18:42PM +0400, Kirill Tkhai wrote:
> > > I was seeking a places where task_group of a task may change. I can't understand
> > > how changing of parent's cgroup during fork() applies to a child.
> >
> > I didn't know we could change cgroup on fork(), I though the idea was
> > you always inherited your parents cgroup.
> >
> > How can this be?
>
> Hmmm? -ENEEDMORECONTEXT but the inheriting happens at one point during
> fork in cgroup_post_fork(). The child inherits whatever the parent
> cgroup is at that point.
So Kirill is saying that there is a race between fork and attach such
that a child can end up in a different cgroup than the parent and we
need to use the cgroup_subsys::fork call to fix that up.
I was always under the impression that fork was an 'atomic' operation
from the point of cgroups, an attach (or move) would happen either
before the fork or after, not during. But I appear to be mistaken in
that assumption, going by the comments around cgroup_post_fork().
next prev parent reply other threads:[~2014-10-27 13:28 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-24 15:07 [PATCH] sched: reset sched_entity depth on changing parent Burke Libbey
2014-10-24 15:58 ` Peter Zijlstra
2014-10-24 17:18 ` Kirill Tkhai
2014-10-27 9:49 ` Kirill Tkhai
2014-10-27 12:07 ` Peter Zijlstra
2014-10-27 12:40 ` Tejun Heo
2014-10-27 13:28 ` Peter Zijlstra [this message]
2014-10-27 13:36 ` Kirill Tkhai
2014-10-27 13:45 ` Peter Zijlstra
2014-10-27 13:48 ` Kirill Tkhai
2014-10-27 13:47 ` Tejun Heo
2014-10-27 13:48 ` Tejun Heo
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=20141027132812.GG3337@twins.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=burke.libbey@shopify.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=tj@kernel.org \
--cc=tkhai@yandex.ru \
/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