From: Peter Zijlstra <peterz@infradead.org>
To: Frederic Weisbecker <fweisbec@gmail.com>
Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
tglx@linutronix.de, linux-kernel@vger.kernel.org,
rgkernel@gmail.com
Subject: Re: [PATCH RFC] sched: Make wake_up_nohz_cpu() handle CPUs going offline
Date: Tue, 12 Jul 2016 16:19:55 +0200 [thread overview]
Message-ID: <20160712141955.GS30909@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <20160630232957.GB32568@lerouge>
On Fri, Jul 01, 2016 at 01:29:59AM +0200, Frederic Weisbecker wrote:
> > void wake_up_nohz_cpu(int cpu)
> > {
> > - if (!wake_up_full_nohz_cpu(cpu))
> > + if (cpu_online(cpu) && !wake_up_full_nohz_cpu(cpu))
>
> So at this point, as we passed CPU_DYING, I believe the CPU isn't visible in the domains
> anymore (correct me if I'm wrong),
So rebuilding the domains is an utter trainwreck atm. But I suspect
that's wrong. Esp. with cpusets enabled we rebuild the domains very late
from a workqueue.
That is why the scheduler has cpu_active_mask to constrain the domains
during hotplug.
Now I need to go sort through that trainwreck because deadline needs it,
but I've not had the opportunity :/
> therefore get_nohz_timer_target() can't return it,
> unless smp_processor_id() is the only alternative.
With the below that should be true I think.
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 6c0cdb5a73f8..b35cacbe9b9e 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -626,7 +626,7 @@ int get_nohz_timer_target(void)
rcu_read_lock();
for_each_domain(cpu, sd) {
- for_each_cpu(i, sched_domain_span(sd)) {
+ for_each_cpu_and(i, sched_domain_span(sd), cpu_active_mask) {
if (!idle_cpu(i) && is_housekeeping_cpu(cpu)) {
cpu = i;
goto unlock;
prev parent reply other threads:[~2016-07-12 14:19 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-30 17:58 Paul E. McKenney
2016-06-30 23:29 ` Frederic Weisbecker
2016-07-01 18:40 ` Paul E. McKenney
2016-07-01 23:49 ` Frederic Weisbecker
2016-07-02 0:15 ` Paul E. McKenney
2016-07-04 12:21 ` Frederic Weisbecker
2016-07-04 16:55 ` Paul E. McKenney
2016-07-12 14:41 ` Paul E. McKenney
2016-07-12 14:19 ` Peter Zijlstra [this message]
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=20160712141955.GS30909@twins.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=paulmck@linux.vnet.ibm.com \
--cc=rgkernel@gmail.com \
--cc=tglx@linutronix.de \
/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