diff options
author | Paul E. McKenney <paul.mckenney@linaro.org> | 2011-10-07 12:22:05 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2011-12-11 13:31:34 -0500 |
commit | 867f236bd12f5091df6dc7cc75f94d7fd982d78a (patch) | |
tree | a509f021062780e5a1f2ab8e5a63f7f016a14c28 /include/linux/srcu.h | |
parent | ff195cb69ba8d2af9b891be3a26db95fe1999d43 (diff) |
rcu: Make srcu_read_lock_held() call common lockdep-enabled function
A common debug_lockdep_rcu_enabled() function is used to check whether
RCU lockdep splats should be reported, but srcu_read_lock() does not
use it. This commit therefore brings srcu_read_lock_held() up to date.
Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Diffstat (limited to 'include/linux/srcu.h')
-rw-r--r-- | include/linux/srcu.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/linux/srcu.h b/include/linux/srcu.h index 4e0a3d41dae3..d4b12443b2ef 100644 --- a/include/linux/srcu.h +++ b/include/linux/srcu.h | |||
@@ -84,6 +84,9 @@ long srcu_batches_completed(struct srcu_struct *sp); | |||
84 | * this assumes we are in an SRCU read-side critical section unless it can | 84 | * this assumes we are in an SRCU read-side critical section unless it can |
85 | * prove otherwise. | 85 | * prove otherwise. |
86 | * | 86 | * |
87 | * Checks debug_lockdep_rcu_enabled() to prevent false positives during boot | ||
88 | * and while lockdep is disabled. | ||
89 | * | ||
87 | * Note that if the CPU is in the idle loop from an RCU point of view | 90 | * Note that if the CPU is in the idle loop from an RCU point of view |
88 | * (ie: that we are in the section between rcu_idle_enter() and | 91 | * (ie: that we are in the section between rcu_idle_enter() and |
89 | * rcu_idle_exit()) then srcu_read_lock_held() returns false even if | 92 | * rcu_idle_exit()) then srcu_read_lock_held() returns false even if |
@@ -102,7 +105,7 @@ static inline int srcu_read_lock_held(struct srcu_struct *sp) | |||
102 | if (rcu_is_cpu_idle()) | 105 | if (rcu_is_cpu_idle()) |
103 | return 0; | 106 | return 0; |
104 | 107 | ||
105 | if (!debug_locks) | 108 | if (!debug_lockdep_rcu_enabled()) |
106 | return 1; | 109 | return 1; |
107 | 110 | ||
108 | return lock_is_held(&sp->dep_map); | 111 | return lock_is_held(&sp->dep_map); |