[PATCH tip/core/rcu 04/23] rcu: ignore offline CPUs in last non-dyntick-idle CPU check

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Paul E. McKenney
Date: Tuesday, April 20, 2010 - 2:44 pm

From: Lai Jiangshan <laijs@cn.fujitsu.com>

Offline CPUs are not in nohz_cpu_mask, but can be ignored when checking
for the last non-dyntick-idle CPU.  This patch therefore only checks
online CPUs for not being dyntick idle, allowing fast entry into
full-system dyntick-idle state even when there are some offline CPUs.

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
 kernel/rcutree_plugin.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/rcutree_plugin.h b/kernel/rcutree_plugin.h
index 79b53bd..687c4e9 100644
--- a/kernel/rcutree_plugin.h
+++ b/kernel/rcutree_plugin.h
@@ -1016,7 +1016,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);
-- 
1.7.0

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH tip/core/rcu 0/23] v3 patches queued for 2.6.35, Paul E. McKenney, (Tue Apr 20, 2:44 pm)
[PATCH tip/core/rcu 02/23] rcu: make dead code really dead, Paul E. McKenney, (Tue Apr 20, 2:44 pm)
[PATCH tip/core/rcu 03/23] rcu: move some code from macro ..., Paul E. McKenney, (Tue Apr 20, 2:44 pm)
[PATCH tip/core/rcu 04/23] rcu: ignore offline CPUs in las ..., Paul E. McKenney, (Tue Apr 20, 2:44 pm)
[PATCH tip/core/rcu 17/23] rcu: improve the RCU CPU-stall ..., Paul E. McKenney, (Tue Apr 20, 2:44 pm)
[PATCH tip/core/rcu 18/23] Debugobjects transition check, Paul E. McKenney, (Tue Apr 20, 2:44 pm)
[PATCH tip/core/rcu 21/23] rcu head remove init, Paul E. McKenney, (Tue Apr 20, 2:44 pm)
[PATCH tip/core/rcu 23/23] rcu: make SRCU usable in modules, Paul E. McKenney, (Tue Apr 20, 2:44 pm)