* [PATCH] rcu: more careful check for the last non-dyntick-idle CPU
@ 2010-03-30 10:40 Lai Jiangshan
2010-03-30 15:50 ` Paul E. McKenney
0 siblings, 1 reply; 2+ messages in thread
From: Lai Jiangshan @ 2010-03-30 10:40 UTC (permalink / raw)
To: Paul E. McKenney, Ingo Molnar, LKML
Warning: I just did build test.
Subject: [PATCH] rcu: more careful check for the last non-dyntick-idle CPU
If a CPU is not in nohz_cpu_mask, it does not means this
CPU is a non-dyntick-idle CPU, because this CPU may be offline or not exist.
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
---
diff --git a/kernel/rcutree_plugin.h b/kernel/rcutree_plugin.h
index 4befb64..6086a7d 100644
--- a/kernel/rcutree_plugin.h
+++ b/kernel/rcutree_plugin.h
@@ -1026,7 +1026,7 @@ int rcu_needs_cpu(int cpu)
/* Don't bother unless we are the last non-dyntick-idle CPU. */
for_each_cpu_not(thatcpu, nohz_cpu_mask)
- if (thatcpu != cpu) {
+ if (cpu_online(thatcpu) && thatcpu != cpu) {
per_cpu(rcu_dyntick_drain, cpu) = 0;
per_cpu(rcu_dyntick_holdoff, cpu) = jiffies - 1;
return rcu_needs_cpu_quick_check(cpu);
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] rcu: more careful check for the last non-dyntick-idle CPU
2010-03-30 10:40 [PATCH] rcu: more careful check for the last non-dyntick-idle CPU Lai Jiangshan
@ 2010-03-30 15:50 ` Paul E. McKenney
0 siblings, 0 replies; 2+ messages in thread
From: Paul E. McKenney @ 2010-03-30 15:50 UTC (permalink / raw)
To: Lai Jiangshan; +Cc: Ingo Molnar, LKML
On Tue, Mar 30, 2010 at 06:40:36PM +0800, Lai Jiangshan wrote:
> Warning: I just did build test.
>
> Subject: [PATCH] rcu: more careful check for the last non-dyntick-idle CPU
>
> If a CPU is not in nohz_cpu_mask, it does not means this
> CPU is a non-dyntick-idle CPU, because this CPU may be offline or not exist.
Good catch, queued, thank you!
Thanx, Paul
> Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
> ---
> diff --git a/kernel/rcutree_plugin.h b/kernel/rcutree_plugin.h
> index 4befb64..6086a7d 100644
> --- a/kernel/rcutree_plugin.h
> +++ b/kernel/rcutree_plugin.h
> @@ -1026,7 +1026,7 @@ int rcu_needs_cpu(int cpu)
>
> /* Don't bother unless we are the last non-dyntick-idle CPU. */
> for_each_cpu_not(thatcpu, nohz_cpu_mask)
> - if (thatcpu != cpu) {
> + if (cpu_online(thatcpu) && thatcpu != cpu) {
> per_cpu(rcu_dyntick_drain, cpu) = 0;
> per_cpu(rcu_dyntick_holdoff, cpu) = jiffies - 1;
> return rcu_needs_cpu_quick_check(cpu);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-03-30 15:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-30 10:40 [PATCH] rcu: more careful check for the last non-dyntick-idle CPU Lai Jiangshan
2010-03-30 15:50 ` Paul E. McKenney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox