From: Kirill Tkhai <tkhai@yandex.ru>
To: Peter Zijlstra <peterz@infradead.org>, Tejun Heo <tj@kernel.org>
Cc: 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 16:36:02 +0300 [thread overview]
Message-ID: <799391414416962@web4j.yandex.ru> (raw)
In-Reply-To: <20141027132812.GG3337@twins.programming.kicks-ass.net>
27.10.2014, 16:28, "Peter Zijlstra" <peterz@infradead.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 mean cgroup is the same, but sched_task_group is other (sched_task_group
is equal to parent's on the moment of dup_task_struct()).
> 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:36 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
2014-10-27 13:36 ` Kirill Tkhai [this message]
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=799391414416962@web4j.yandex.ru \
--to=tkhai@yandex.ru \
--cc=burke.libbey@shopify.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.