aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcutree_plugin.h
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2012-01-04 16:30:33 -0500
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2012-02-21 12:03:23 -0500
commitfe15d706cfc1cb321dbe2329b04b5ca185edff60 (patch)
treebec14ab52167f4f0210e8c207c93922c8270402f /kernel/rcutree_plugin.h
parent18fec7d8758dd416904da205375e6fa667defc80 (diff)
rcu: Add lockdep-RCU checks for simple self-deadlock
It is illegal to have a grace period within a same-flavor RCU read-side critical section, so this commit adds lockdep-RCU checks to splat when such abuse is encountered. This commit does not detect more elaborate RCU deadlock situations. These situations might be a job for lockdep enhancements. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/rcutree_plugin.h')
-rw-r--r--kernel/rcutree_plugin.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/rcutree_plugin.h b/kernel/rcutree_plugin.h
index 8bb35d73e1f9..3680b6b35bf3 100644
--- a/kernel/rcutree_plugin.h
+++ b/kernel/rcutree_plugin.h
@@ -688,6 +688,10 @@ EXPORT_SYMBOL_GPL(call_rcu);
688 */ 688 */
689void synchronize_rcu(void) 689void synchronize_rcu(void)
690{ 690{
691 rcu_lockdep_assert(!lock_is_held(&rcu_bh_lock_map) &&
692 !lock_is_held(&rcu_lock_map) &&
693 !lock_is_held(&rcu_sched_lock_map),
694 "Illegal synchronize_rcu() in RCU read-side critical section");
691 if (!rcu_scheduler_active) 695 if (!rcu_scheduler_active)
692 return; 696 return;
693 wait_rcu_gp(call_rcu); 697 wait_rcu_gp(call_rcu);