lkml.org 
[lkml]   [2011]   [Oct]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 06/11] rcu: Make srcu_read_lock_held() call common lockdep-enabled function
Date
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 <paulmck@linux.vnet.ibm.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
---
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 553c003..05d34cf 100644
--- a/include/linux/srcu.h
+++ b/include/linux/srcu.h
@@ -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
* 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
* (ie: that we are in the section between rcu_idle_enter() and rcu_idle_exit())
* then srcu_read_lock_held() returns false even if the CPU did an srcu_read_lock().
@@ -101,7 +104,7 @@ static inline int srcu_read_lock_held(struct srcu_struct *sp)
if (rcu_is_cpu_idle())
return 0;

- if (!debug_locks)
+ if (!debug_lockdep_rcu_enabled())
return 1;

return lock_is_held(&sp->dep_map);
--
1.7.5.4


\
 
 \ /
  Last update: 2011-10-07 18:25    [W:0.134 / U:2.228 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site