diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2012-01-04 16:30:33 -0500 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2012-02-21 12:03:23 -0500 |
commit | fe15d706cfc1cb321dbe2329b04b5ca185edff60 (patch) | |
tree | bec14ab52167f4f0210e8c207c93922c8270402f /kernel/srcu.c | |
parent | 18fec7d8758dd416904da205375e6fa667defc80 (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/srcu.c')
-rw-r--r-- | kernel/srcu.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/srcu.c b/kernel/srcu.c index 0febf61e1aa3..3f99fa0e8ed3 100644 --- a/kernel/srcu.c +++ b/kernel/srcu.c | |||
@@ -172,6 +172,12 @@ static void __synchronize_srcu(struct srcu_struct *sp, void (*sync_func)(void)) | |||
172 | { | 172 | { |
173 | int idx; | 173 | int idx; |
174 | 174 | ||
175 | rcu_lockdep_assert(!lock_is_held(&sp->dep_map) && | ||
176 | !lock_is_held(&rcu_bh_lock_map) && | ||
177 | !lock_is_held(&rcu_lock_map) && | ||
178 | !lock_is_held(&rcu_sched_lock_map), | ||
179 | "Illegal synchronize_srcu() in same-type SRCU (or RCU) read-side critical section"); | ||
180 | |||
175 | idx = sp->completed; | 181 | idx = sp->completed; |
176 | mutex_lock(&sp->mutex); | 182 | mutex_lock(&sp->mutex); |
177 | 183 | ||