summaryrefslogtreecommitdiffstats
path: root/kernel/rcutiny.c
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2012-01-04 13:30:33 -0800
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2012-02-21 09:03:23 -0800
commitfe15d706cfc1cb321dbe2329b04b5ca185edff60 (patch)
treebec14ab52167f4f0210e8c207c93922c8270402f /kernel/rcutiny.c
parent18fec7d8758dd416904da205375e6fa667defc80 (diff)
downloadlinux-fe15d706cfc1cb321dbe2329b04b5ca185edff60.tar.gz
linux-fe15d706cfc1cb321dbe2329b04b5ca185edff60.tar.bz2
linux-fe15d706cfc1cb321dbe2329b04b5ca185edff60.zip
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/rcutiny.c')
-rw-r--r--kernel/rcutiny.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/rcutiny.c b/kernel/rcutiny.c
index 977296dca0a4..8e00d461911e 100644
--- a/kernel/rcutiny.c
+++ b/kernel/rcutiny.c
@@ -319,6 +319,10 @@ static void rcu_process_callbacks(struct softirq_action *unused)
*/
void synchronize_sched(void)
{
+ rcu_lockdep_assert(!lock_is_held(&rcu_bh_lock_map) &&
+ !lock_is_held(&rcu_lock_map) &&
+ !lock_is_held(&rcu_sched_lock_map),
+ "Illegal synchronize_sched() in RCU read-side critical section");
cond_resched();
}
EXPORT_SYMBOL_GPL(synchronize_sched);