mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
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>
This commit is contained in:
parent
ff195cb69b
commit
867f236bd1
1 changed files with 4 additions and 1 deletions
|
@ -84,6 +84,9 @@ long srcu_batches_completed(struct srcu_struct *sp);
|
||||||
* this assumes we are in an SRCU read-side critical section unless it can
|
* this assumes we are in an SRCU read-side critical section unless it can
|
||||||
* prove otherwise.
|
* prove otherwise.
|
||||||
*
|
*
|
||||||
|
* Checks debug_lockdep_rcu_enabled() to prevent false positives during boot
|
||||||
|
* and while lockdep is disabled.
|
||||||
|
*
|
||||||
* Note that if the CPU is in the idle loop from an RCU point of view
|
* Note that if the CPU is in the idle loop from an RCU point of view
|
||||||
* (ie: that we are in the section between rcu_idle_enter() and
|
* (ie: that we are in the section between rcu_idle_enter() and
|
||||||
* rcu_idle_exit()) then srcu_read_lock_held() returns false even if
|
* 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)
|
||||||
if (rcu_is_cpu_idle())
|
if (rcu_is_cpu_idle())
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (!debug_locks)
|
if (!debug_lockdep_rcu_enabled())
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
return lock_is_held(&sp->dep_map);
|
return lock_is_held(&sp->dep_map);
|
||||||
|
|
Loading…
Reference in a new issue