login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2010
»
April
»
14
Re: Weird rcu lockdep warning
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Frederic Weisbecker
Subject:
Re: Weird rcu lockdep warning
Date: Wednesday, April 14, 2010 - 8:51 am
On Wed, Apr 14, 2010 at 08:43:02AM -0700, Paul E. McKenney wrote:
quoted text
> On Wed, Apr 14, 2010 at 11:34:33AM +0800, Lai Jiangshan wrote: > > Paul E. McKenney wrote: > > > On Tue, Apr 13, 2010 at 05:13:06PM -0700, David Miller wrote: > > >> From: Frederic Weisbecker <fweisbec@gmail.com> > > >> Date: Wed, 14 Apr 2010 02:02:27 +0200 > > >> > > >>> I just have a guess though.... > > >>> This seems to always happen from NMI path, and lockdep is disabled on NMI. > > >>> I suspect the lock_acquire() performed by rcu_read_lock() is just ignored > > >>> and then the rcu_read_lock_held() check has the wrong result... > > >> Yeah, I bet that's it too. > > >> > > >> lock_is_held() can't return anything meaningful while lockdep is > > >> disabled, which it is during NMIs. > > > > > > Ah! So I just need to add a "current->lockdep_recursion" > > > check to debug_lockdep_rcu_enabled(). And move the function to > > > kernel/rcutree_plugin.h to avoid #include hell. > > > > > > See below for (untested) patch. > > > > > > Thanx, Paul > > > > > > ------------------------------------------------------------------------ > > > > > > include/linux/rcupdate.h | 5 +---- > > > kernel/rcutree_plugin.h | 11 +++++++++++ > > > 2 files changed, 12 insertions(+), 4 deletions(-) > > > > > > commit 304d8da6cd791a81ce3164f867e1b3ef4f9af1d1 > > > Author: Paul E. McKenney <paulmck@linux.vnet.ibm.com> > > > Date: Tue Apr 13 18:45:51 2010 -0700 > > > > > > rcu: Make RCU lockdep check the lockdep_recursion variable > > > > > > The lockdep facility temporarily disables lockdep checking by incrementing > > > the current->lockdep_recursion variable. Such disabling happens in NMIs > > > and in other situations where lockdep might expect to recurse on itself. > > > This patch therefore checks current->lockdep_recursion, disabling RCU > > > lockdep splats when this variable is non-zero. > > > > > > Reported-by: Frederic Weisbecker <fweisbec@gmail.com> > > > Reported-by: David Miller <davem@davemloft.net> > > > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> > > > > > > diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h > > > index 9f1ddfe..07db2fe 100644 > > > --- a/include/linux/rcupdate.h > > > +++ b/include/linux/rcupdate.h > > > @@ -101,10 +101,7 @@ extern struct lockdep_map rcu_sched_lock_map; > > > # define rcu_read_release_sched() \ > > > lock_release(&rcu_sched_lock_map, 1, _THIS_IP_) > > > > > > -static inline int debug_lockdep_rcu_enabled(void) > > > -{ > > > - return likely(rcu_scheduler_active && debug_locks); > > > -} > > > +extern int debug_lockdep_rcu_enabled(void); > > > > > > /** > > > * rcu_read_lock_held - might we be in RCU read-side critical section? > > > diff --git a/kernel/rcutree_plugin.h b/kernel/rcutree_plugin.h > > > index 79b53bd..2169abe 100644 > > > --- a/kernel/rcutree_plugin.h > > > +++ b/kernel/rcutree_plugin.h > > > @@ -1067,3 +1067,14 @@ static void rcu_needs_cpu_flush(void) > > > } > > > > > > #endif /* #else #if !defined(CONFIG_RCU_FAST_NO_HZ) */ > > > + > > > +#ifdef CONFIG_DEBUG_LOCK_ALLOC > > > + > > > +int debug_lockdep_rcu_enabled(void) > > > +{ > > > + return likely(rcu_scheduler_active && > > > + debug_locks && > > > + current->lockdep_recursion == 0); > > > +} > > > + > > > > Looks good to me too, but I think > > 'likely' is needless since the function is not inline. > > Good point. And to add injury to insult, I forgot EXPORT_SYMBOL_GPL(). > > Updated patch in the works.
Note I just tested the patch the previous one and it looks fine now. You can then safely consider the "general idea" fixes the problem :) Thanks. --
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
Weird rcu lockdep warning
, Frederic Weisbecker
, (Tue Apr 13, 1:04 pm)
Re: Weird rcu lockdep warning
, Paul E. McKenney
, (Tue Apr 13, 4:40 pm)
Re: Weird rcu lockdep warning
, Frederic Weisbecker
, (Tue Apr 13, 5:02 pm)
Re: Weird rcu lockdep warning
, David Miller
, (Tue Apr 13, 5:13 pm)
Re: Weird rcu lockdep warning
, Paul E. McKenney
, (Tue Apr 13, 6:49 pm)
Re: Weird rcu lockdep warning
, David Miller
, (Tue Apr 13, 6:51 pm)
Re: Weird rcu lockdep warning
, Lai Jiangshan
, (Tue Apr 13, 8:34 pm)
Re: Weird rcu lockdep warning
, Paul E. McKenney
, (Wed Apr 14, 8:43 am)
Re: Weird rcu lockdep warning
, Frederic Weisbecker
, (Wed Apr 14, 8:51 am)
Re: Weird rcu lockdep warning
, Paul E. McKenney
, (Wed Apr 14, 9:00 am)
Re: Weird rcu lockdep warning
, Paul E. McKenney
, (Wed Apr 14, 9:24 pm)
Re: Weird rcu lockdep warning
, Frederic Weisbecker
, (Thu Apr 15, 11:57 am)
Re: Weird rcu lockdep warning
, Paul E. McKenney
, (Thu Apr 15, 12:47 pm)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Ken Chen
[patch] sched: fix inconsistency when redistribute per-cpu tg->cfs_rq shares.
Ingo Molnar
Re: [PATCH v3] x86: merge the simple bitops and move them to bitops.h
Paul Turner
[tg_shares_up rewrite v4 11/11] sched: update tg->shares after cpu.shares write
Andi Kleen
Re: - romsignature-checksum-cleanup-2.patch removed from -mm tree
Axel Lin
[PATCH] tc6393xb: fix wrong goto labels for error handling
git
:
Christian Jaeger
Re: Problem with Git.pm bidi_pipe methods
Linus Torvalds
Re: mingw, windows, crlf/lf, and git
Nicolas Pitre
Re: [PATCH 2/2] Implement a simple delta_base cache
Linus Torvalds
[PATCH 1/7] Make unpack_trees_options bit flags actual bitfields
Jeff King
[PATCH 1/4] t4012: use test_cmp instead of cmp
git-commits-head
:
Linux Kernel Mailing List
i2c-i801: Add Intel Cougar Point device IDs
Linux Kernel Mailing List
Staging: batman-adv: splitting /proc vis file into vis_server and vis_data
Linux Kernel Mailing List
drm/i915: Add information on pinning and fencing to the i915 list debug.
Linux Kernel Mailing List
ocfs2: Stop orphan scan as early as possible during umount
Linux Kernel Mailing List
x86, apic: clean up spurious vector sanity check
linux-netdev
:
Richard Cochran
Re: [PATCH v3 3/3] ptp: Added a clock that uses the eTSEC found on the MPC85xx.
Gerrit Renker
v2 [PATCH 1/4] dccp: Limit feature negotiation to connection setup phase
Lennert Buytenhek
Re: [PATCH 3/6] [NET] dsa: add support for original DSA tagging format
Inaky Perez-Gonzalez
[PATCH 40/40] wimax/i2400m: add CREDITS and MAINTAINERS entries
Pavel Emelyanov
[PATCH net-2.6.26 2/2][NETNS]: The generic per-net pointers.
freebsd-current
:
Boris Samorodov
Re: twa + dump = sbwait
John Baldwin
Re: Possible case of sched_ule never honoring cpu_set affinity?
韓家標 Bill Hacker
Re: ZFS honesty
samira
sata atapi on ich9r
Bjoern A. Zeeb
Re: Can not boot 7.0-BETA3 with IPSEC
Colocation donated by:
Syndicate