public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Vincent Guittot <vincent.guittot@linaro.org>
Cc: linux-kernel@vger.kernel.org, linaro-kernel@lists.linaro.org,
	mingo@kernel.org, fweisbec@gmail.com, pjt@google.com,
	rostedt@goodmis.org, efault@gmx.de
Subject: Re: [PATCH v8] sched: fix init NOHZ_IDLE flag
Date: Thu, 25 Apr 2013 18:32:42 +0200	[thread overview]
Message-ID: <20130425163242.GC5828@dyad.programming.kicks-ass.net> (raw)
In-Reply-To: <1366729142-14662-1-git-send-email-vincent.guittot@linaro.org>

On Tue, Apr 23, 2013 at 04:59:02PM +0200, Vincent Guittot wrote:
> On my smp platform which is made of 5 cores in 2 clusters, I have the
> nr_busy_cpu field of sched_group_power struct that is not null when the
> platform is fully idle. The root cause is:
> During the boot sequence, some CPUs reach the idle loop and set their
> NOHZ_IDLE flag while waiting for others CPUs to boot. But the nr_busy_cpus
> field is initialized later with the assumption that all CPUs are in the busy
> state whereas some CPUs have already set their NOHZ_IDLE flag.
> 
> More generally, the NOHZ_IDLE flag must be initialized when new sched_domains
> are created in order to ensure that NOHZ_IDLE and nr_busy_cpus are aligned.
> 
> This condition can be ensured by adding a synchronize_rcu between the
> destruction of old sched_domains and the creation of new ones so the NOHZ_IDLE
> flag will not be updated with old sched_domain once it has been initialized.
> But this solution introduces a additionnal latency in the rebuild sequence
> that is called during cpu hotplug.
> 
> As suggested by Frederic Weisbecker, another solution is to have the same
> rcu lifecycle for both NOHZ_IDLE and sched_domain struct.
> A new nohz_idle field is added to sched_domain so both status and sched_domain
> will share the same RCU lifecycle and will be always synchronized.
> In addition, there is no more need to protect nohz_idle against concurrent
>  access as it is only modified by 2 exclusive functions called by local cpu.
> 
> This solution has been prefered to the creation of a new struct with an extra
> pointer indirection for sched_domain.

> Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>

Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>

Thanks for persisting!

  reply	other threads:[~2013-04-25 16:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-23 14:59 [PATCH v8] sched: fix init NOHZ_IDLE flag Vincent Guittot
2013-04-25 16:32 ` Peter Zijlstra [this message]
2013-04-26 14:23 ` [tip:sched/core] sched: Fix " tip-bot for Vincent Guittot

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=20130425163242.GC5828@dyad.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=efault@gmx.de \
    --cc=fweisbec@gmail.com \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=pjt@google.com \
    --cc=rostedt@goodmis.org \
    --cc=vincent.guittot@linaro.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