From: Peter Zijlstra <peterz@infradead.org>
To: Kirill Tkhai <tkhai@yandex.ru>
Cc: Tejun Heo <tj@kernel.org>,
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:45:08 +0100 [thread overview]
Message-ID: <20141027134508.GI3337@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <799391414416962@web4j.yandex.ru>
On Mon, Oct 27, 2014 at 04:36:02PM +0300, Kirill Tkhai wrote:
>
>
> 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()).
But that still means the parent changed cgroup during fork right? It
started out in a different cgroup than it ended up with, and we need
that .fork callback to fixup state.
next prev parent reply other threads:[~2014-10-27 13:45 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
2014-10-27 13:45 ` Peter Zijlstra [this message]
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=20141027134508.GI3337@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 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.