mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Cc: Tejun Heo <tj@kernel.org>, Ingo Molnar <mingo@redhat.com>,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH 1/2] sched/cgroup: move sched_online_group() back into css_online()
Date: Thu, 26 Jan 2017 11:17:02 +0100	[thread overview]
Message-ID: <20170126101702.GX6515@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <148542370148.63697.501199781041713381.stgit@buzz>

On Thu, Jan 26, 2017 at 12:41:41PM +0300, Konstantin Khlebnikov wrote:
> Commit 2f5177f0fd7e ("sched/cgroup: Fix/cleanup cgroup teardown/init") moved
> sched_online_group() from css_online() to css_alloc(). It exposes half-baked
> task group into global lists before initializing generic cgroup stuff.
> 
> LTP testcase (third in cgroup_regression_test) written for testing
> similar race in kernels 2.6.26-2.6.28 easily triggers this oops:
> 

So nobody's run LTP against the kernel for almost a year?

> 
> Here task group already linked into global RCU-protected list task_groups
> but pointer css->cgroup is still NULL.
> 
> This patch reverts this chunk and moves online back to css_online().

Maybe put a comment with it that explains why this is needed?

Something along the lines of this perhaps?

/*
 * Don't expose the cgroup until initialization of it is complete in the
 * cgroup core. Otherwise things like cgroup_path() will return NULL
 * pointers and the like.
 */

> +static int cpu_cgroup_css_online(struct cgroup_subsys_state *css)
> +{
> +	struct task_group *tg = css_tg(css);
> +	struct task_group *parent = css_tg(css->parent);
> +
> +	if (parent)
> +		sched_online_group(tg, parent);
> +	return 0;
> +}

  parent reply	other threads:[~2017-01-26 10:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-26  9:41 Konstantin Khlebnikov
2017-01-26  9:41 ` [PATCH 2/2] kernfs: define name and path to "(null)" for NULL pointer kernfs nodes Konstantin Khlebnikov
2017-01-26 19:37   ` Tejun Heo
2017-01-26 21:50     ` [PATCH cgroup/for-4.10-fixes] cgroup: don't online subsystems before cgroup_name/path() are operational Tejun Heo
2017-01-26 10:17 ` Peter Zijlstra [this message]
2017-01-26 10:27   ` [PATCH 1/2] sched/cgroup: move sched_online_group() back into css_online() Konstantin Khlebnikov
2017-02-08 11:27 ` [PATCH RESEND/add comment] " Konstantin Khlebnikov
2017-02-24  9:19   ` [tip:sched/urgent] sched/cgroup: Move sched_online_group() back into css_online() to fix crash tip-bot for Konstantin Khlebnikov

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=20170126101702.GX6515@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=khlebnikov@yandex-team.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=stable@vger.kernel.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

Powered by JetHome