diff mbox

[RFC,tip/core/rcu,17/28] rcu: Make srcu_read_lock_held() call common lockdep-enabled function

Message ID 1320265849-5744-17-git-send-email-paulmck@linux.vnet.ibm.com
State Accepted
Commit 867f236bd12f5091df6dc7cc75f94d7fd982d78a
Headers show

Commit Message

Paul E. McKenney Nov. 2, 2011, 8:30 p.m. UTC
From: Frederic Weisbecker <fweisbec@gmail.com>

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>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
 include/linux/srcu.h |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

Comments

Josh Triplett Nov. 3, 2011, 3:48 a.m. UTC | #1
On Wed, Nov 02, 2011 at 01:30:38PM -0700, Paul E. McKenney wrote:
> From: Frederic Weisbecker <fweisbec@gmail.com>
> 
> 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>
> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>

Just how signed off does this patch need to be? ;)

- Josh Triplett
Frederic Weisbecker Nov. 3, 2011, 11:14 a.m. UTC | #2
On Wed, Nov 02, 2011 at 08:48:54PM -0700, Josh Triplett wrote:
> On Wed, Nov 02, 2011 at 01:30:38PM -0700, Paul E. McKenney wrote:
> > From: Frederic Weisbecker <fweisbec@gmail.com>
> > 
> > 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>
> > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> 
> Just how signed off does this patch need to be? ;)

Dunno but I feel uncomfortable now with that strange feeling I'm walking
on the street with two Paul holding my hand on each side.
Steven Rostedt Nov. 3, 2011, 1:19 p.m. UTC | #3
On Thu, 2011-11-03 at 12:14 +0100, Frederic Weisbecker wrote:
> On Wed, Nov 02, 2011 at 08:48:54PM -0700, Josh Triplett wrote:
> > On Wed, Nov 02, 2011 at 01:30:38PM -0700, Paul E. McKenney wrote:
> > > From: Frederic Weisbecker <fweisbec@gmail.com>
> > > 
> > > 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>
> > > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> > 
> > Just how signed off does this patch need to be? ;)
> 
> Dunno but I feel uncomfortable now with that strange feeling I'm walking
> on the street with two Paul holding my hand on each side.

We already established the split Paul, but what is really scarey, is
that the Pauls on both sides of you, are the evil Pauls. ;)

-- Steve
Paul E. McKenney Nov. 3, 2011, 1:29 p.m. UTC | #4
On Thu, Nov 03, 2011 at 12:14:20PM +0100, Frederic Weisbecker wrote:
> On Wed, Nov 02, 2011 at 08:48:54PM -0700, Josh Triplett wrote:
> > On Wed, Nov 02, 2011 at 01:30:38PM -0700, Paul E. McKenney wrote:
> > > From: Frederic Weisbecker <fweisbec@gmail.com>
> > > 
> > > 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>
> > > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> > 
> > Just how signed off does this patch need to be? ;)

If you have sufficient patience to scroll past the Signed-off-by's
to see the patch, then there clearly are not enough.  ;-)

> Dunno but I feel uncomfortable now with that strange feeling I'm walking
> on the street with two Paul holding my hand on each side.

I did catch one of these, but missed the other.  Here is the history:

o	Paul wrote the patch.

o	Frederic reworked the patches that this one depended on,
	and then resent the patch.

o	Paul did "git am -s" on the series that Frederic sent,
	which added the extra Signed-off-by.
	
It is not clear to me what the Signed-off-by chain should look like in
this case.  My default action would be to remove my second Signed-off-by.

							Thanx, Paul
Paul E. McKenney Nov. 3, 2011, 1:30 p.m. UTC | #5
On Thu, Nov 03, 2011 at 09:19:26AM -0400, Steven Rostedt wrote:
> On Thu, 2011-11-03 at 12:14 +0100, Frederic Weisbecker wrote:
> > On Wed, Nov 02, 2011 at 08:48:54PM -0700, Josh Triplett wrote:
> > > On Wed, Nov 02, 2011 at 01:30:38PM -0700, Paul E. McKenney wrote:
> > > > From: Frederic Weisbecker <fweisbec@gmail.com>
> > > > 
> > > > 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>
> > > > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> > > 
> > > Just how signed off does this patch need to be? ;)
> > 
> > Dunno but I feel uncomfortable now with that strange feeling I'm walking
> > on the street with two Paul holding my hand on each side.
> 
> We already established the split Paul, but what is really scarey, is
> that the Pauls on both sides of you, are the evil Pauls. ;)

Well, I -could- make the first one by my linaro.org address and the
second one be my linux.vnet.ibm.com address...  ;-)

							Thanx, Paul
Steven Rostedt Nov. 3, 2011, 1:59 p.m. UTC | #6
On Thu, 2011-11-03 at 06:29 -0700, Paul E. McKenney wrote:
> On Thu, Nov 03, 2011 at 12:14:20PM +0100, Frederic Weisbecker wrote:
> > On Wed, Nov 02, 2011 at 08:48:54PM -0700, Josh Triplett wrote:
> > > On Wed, Nov 02, 2011 at 01:30:38PM -0700, Paul E. McKenney wrote:
> > > > From: Frederic Weisbecker <fweisbec@gmail.com>
> > > > 
> > > > 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>
> > > > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> > > 
> > > Just how signed off does this patch need to be? ;)
> 
> If you have sufficient patience to scroll past the Signed-off-by's
> to see the patch, then there clearly are not enough.  ;-)
> 
> > Dunno but I feel uncomfortable now with that strange feeling I'm walking
> > on the street with two Paul holding my hand on each side.
> 
> I did catch one of these, but missed the other.  Here is the history:
> 
> o	Paul wrote the patch.
> 
> o	Frederic reworked the patches that this one depended on,
> 	and then resent the patch.
> 
> o	Paul did "git am -s" on the series that Frederic sent,
> 	which added the extra Signed-off-by.
> 	
> It is not clear to me what the Signed-off-by chain should look like in
> this case.  My default action would be to remove my second Signed-off-by.

The author should be you (change the From: to you not Frederic), and
then the first SoB would be Frederic, and yours at the end as you
committed it.

I would also state in the change log what Frederic did to the original
patch.

-- Steve
Paul E. McKenney Nov. 3, 2011, 8:14 p.m. UTC | #7
On Thu, Nov 03, 2011 at 09:59:02AM -0400, Steven Rostedt wrote:
> On Thu, 2011-11-03 at 06:29 -0700, Paul E. McKenney wrote:
> > On Thu, Nov 03, 2011 at 12:14:20PM +0100, Frederic Weisbecker wrote:
> > > On Wed, Nov 02, 2011 at 08:48:54PM -0700, Josh Triplett wrote:
> > > > On Wed, Nov 02, 2011 at 01:30:38PM -0700, Paul E. McKenney wrote:
> > > > > From: Frederic Weisbecker <fweisbec@gmail.com>
> > > > > 
> > > > > 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>
> > > > > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> > > > 
> > > > Just how signed off does this patch need to be? ;)
> > 
> > If you have sufficient patience to scroll past the Signed-off-by's
> > to see the patch, then there clearly are not enough.  ;-)
> > 
> > > Dunno but I feel uncomfortable now with that strange feeling I'm walking
> > > on the street with two Paul holding my hand on each side.
> > 
> > I did catch one of these, but missed the other.  Here is the history:
> > 
> > o	Paul wrote the patch.
> > 
> > o	Frederic reworked the patches that this one depended on,
> > 	and then resent the patch.
> > 
> > o	Paul did "git am -s" on the series that Frederic sent,
> > 	which added the extra Signed-off-by.
> > 	
> > It is not clear to me what the Signed-off-by chain should look like in
> > this case.  My default action would be to remove my second Signed-off-by.
> 
> The author should be you (change the From: to you not Frederic), and
> then the first SoB would be Frederic, and yours at the end as you
> committed it.
> 
> I would also state in the change log what Frederic did to the original
> patch.

Fair enough!

							Thanx, Paul
diff mbox

Patch

diff --git a/include/linux/srcu.h b/include/linux/srcu.h
index 4e0a3d4..d4b1244 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
@@ -102,7 +105,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);