aboutsummaryrefslogtreecommitdiff
path: root/kernel/rcutree.c
diff options
context:
space:
mode:
authorPaul E. McKenney <paul.mckenney@linaro.org>2012-05-26 08:56:01 -0700
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2012-07-02 12:34:24 -0700
commita16b7a693430406dc229ab0c6b154f669a2031c5 (patch)
treeb43738c2f447eb4a88fc931d799c33190d56f689 /kernel/rcutree.c
parent62fde6edf12b60fddb13a3f0a779c8be0bb7447e (diff)
rcu: Prevent __call_rcu() from invoking RCU core on offline CPUs
The __call_rcu() function will invoke the RCU core, for example, if it detects that the current CPU has too many callbacks. However, this can happen on an offline CPU that is on its way to the idle loop, in which case it is an error to invoke the RCU core, and the excess callbacks will be adopted in any case. This commit therefore adds checks to __call_rcu() for running on an offline CPU, refraining from invoking the RCU core in this case. Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Diffstat (limited to 'kernel/rcutree.c')
-rw-r--r--kernel/rcutree.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/rcutree.c b/kernel/rcutree.c
index a4a9c916ad3..ceaa95923a8 100644
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -1904,11 +1904,11 @@ __call_rcu(struct rcu_head *head, void (*func)(struct rcu_head *rcu),
* If called from an extended quiescent state, invoke the RCU
* core in order to force a re-evaluation of RCU's idleness.
*/
- if (rcu_is_cpu_idle())
+ if (rcu_is_cpu_idle() && cpu_online(smp_processor_id()))
invoke_rcu_core();
- /* If interrupts were disabled, don't dive into RCU core. */
- if (irqs_disabled_flags(flags)) {
+ /* If interrupts were disabled or CPU offline, don't invoke RCU core. */
+ if (irqs_disabled_flags(flags) || cpu_is_offline(smp_processor_id())) {
local_irq_restore(flags);
return;
}