aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/rcutree.h
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2012-01-04 14:44:57 -0500
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2012-02-21 12:03:22 -0500
commit18fec7d8758dd416904da205375e6fa667defc80 (patch)
tree768f505120e075d9f93b83d0657dcaf712ea18e0 /include/linux/rcutree.h
parent4c62abc90bea439a4b50aad9f67a310fb9c392e1 (diff)
rcu: Improve synchronize_rcu() diagnostics
Although TREE_PREEMPT_RCU indirectly uses might_sleep() to detect illegal use of synchronize_sched() and synchronize_rcu_bh() from within an RCU read-side critical section, this might_sleep() check is bypassed when there is only a single CPU (for example, when running an SMP kernel on a single-CPU system). This patch therefore adds a might_sleep() call to the rcu_blocking_is_gp() check that is unconditionally invoked from both synchronize_sched() and synchronize_rcu_bh(). Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'include/linux/rcutree.h')
-rw-r--r--include/linux/rcutree.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h
index 67458468f1a8..73e7195f9997 100644
--- a/include/linux/rcutree.h
+++ b/include/linux/rcutree.h
@@ -83,6 +83,7 @@ extern void rcu_sched_force_quiescent_state(void);
83/* A context switch is a grace period for RCU-sched and RCU-bh. */ 83/* A context switch is a grace period for RCU-sched and RCU-bh. */
84static inline int rcu_blocking_is_gp(void) 84static inline int rcu_blocking_is_gp(void)
85{ 85{
86 might_sleep(); /* Check for RCU read-side critical section. */
86 return num_online_cpus() == 1; 87 return num_online_cpus() == 1;
87} 88}
88 89