aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kernel/rcutree.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/kernel/rcutree.c b/kernel/rcutree.c
index 1c40326724f..69b6cdd4f94 100644
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -556,12 +556,16 @@ void rcu_nmi_exit(void)
* rcu_is_cpu_idle - see if RCU thinks that the current CPU is idle
*
* If the current CPU is in its idle loop and is neither in an interrupt
- * or NMI handler, return true. The caller must have at least disabled
- * preemption.
+ * or NMI handler, return true.
*/
int rcu_is_cpu_idle(void)
{
- return (atomic_read(&__get_cpu_var(rcu_dynticks).dynticks) & 0x1) == 0;
+ int ret;
+
+ preempt_disable();
+ ret = (atomic_read(&__get_cpu_var(rcu_dynticks).dynticks) & 0x1) == 0;
+ preempt_enable();
+ return ret;
}
#endif /* #ifdef CONFIG_PROVE_RCU */