Skip to contentSkip to conversation

rcu: more careful check for the last non-dyntick-idle CPU

PATCH In review Lai Jiangshan 2 participants 2 messages Mar 30, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rcu: more careful check for the last non-dyntick-idle CPU

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.

---

kernel/rcutree_plugin.h +1 -1
index 4befb64..6086a7d 100644
@@ -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);
#1 lore raw
Quoted 6 lines · Lai Jiangshan

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

Quoted 15 lines

---

kernel/rcutree_plugin.h +1 -1
index 4befb64..6086a7d 100644
@@ -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);