login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2010
»
May
»
1
Re: [PATCH] RCU: don't turn off lockdep when find suspicious rcu_dereference_check() usage
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Miles Lane
Subject:
Re: [PATCH] RCU: don't turn off lockdep when find suspicious rcu_dereference_check() usage
Date: Saturday, May 1, 2010 - 10:26 am
On Tue, Apr 20, 2010 at 9:52 AM, Paul E. McKenney <paulmck@linux.vnet.ibm.com> wrote:
quoted text
> On Tue, Apr 20, 2010 at 08:45:28AM -0400, Miles Lane wrote: >> Is there a patch set for 2.6.34-rc5 I can test? > > I will be sending a patchset out later today after testing, but > please see below for a sneak preview collapsed into a single patch. > > Thanx, Paul > >> On Tue, Apr 20, 2010 at 8:31 AM, Eric Paris <eparis@redhat.com> wrote: >> >> > On Tue, 2010-04-20 at 16:23 +0800, Lai Jiangshan wrote: >> > >> > > [PATCH] RCU: don't turn off lockdep when find suspicious >> > rcu_dereference_check() usage >> > > >> > > When suspicious rcu_dereference_check() usage is detected, lockdep is >> > still >> > > available actually, so we should not call debug_locks_off() in >> > > lockdep_rcu_dereference(). >> > > >> > > For get rid of too much "suspicious rcu_dereference_check() usage" >> > > output when the "if(!debug_locks_off())" statement is removed. This patch >> > uses >> > > static variable '__warned's for very usage of "rcu_dereference*()". >> > > >> > > One variable per usage, so, Now, we can get multiple complaint >> > > when we detect multiple different suspicious rcu_dereference_check() >> > usage. >> > > >> > > Requested-by: Eric Paris <eparis@redhat.com> >> > > Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com> >> > >> > Although mine was a linux-next kernel and it doesn't appear that I have >> > rcu_dereference_protected() at all, so I dropped that bit of the patch, >> > it worked great! I got 4 more complaints to harass people with. Feel >> > free to add my tested by if you care to. >> > >> > Tested-by: Eric Paris <eparis@redhat.com> > > diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h > index 07db2fe..ec9ab49 100644 > --- a/include/linux/rcupdate.h > +++ b/include/linux/rcupdate.h > @@ -190,6 +190,15 @@ static inline int rcu_read_lock_sched_held(void) > > #ifdef CONFIG_PROVE_RCU > > +#define __do_rcu_dereference_check(c) \ > + do { \ > + static bool __warned; \ > + if (debug_lockdep_rcu_enabled() && !__warned && !(c)) { \ > + __warned = true; \ > + lockdep_rcu_dereference(__FILE__, __LINE__); \ > + } \ > + } while (0) > + > /** > * rcu_dereference_check - rcu_dereference with debug checking > * @p: The pointer to read, prior to dereferencing > @@ -219,8 +228,7 @@ static inline int rcu_read_lock_sched_held(void) > */ > #define rcu_dereference_check(p, c) \ > ({ \ > - if (debug_lockdep_rcu_enabled() && !(c)) \ > - lockdep_rcu_dereference(__FILE__, __LINE__); \ > + __do_rcu_dereference_check(c); \ > rcu_dereference_raw(p); \ > }) > > @@ -237,8 +245,7 @@ static inline int rcu_read_lock_sched_held(void) > */ > #define rcu_dereference_protected(p, c) \ > ({ \ > - if (debug_lockdep_rcu_enabled() && !(c)) \ > - lockdep_rcu_dereference(__FILE__, __LINE__); \ > + __do_rcu_dereference_check(c); \ > (p); \ > }) > > diff --git a/kernel/cgroup_freezer.c b/kernel/cgroup_freezer.c > index da5e139..e5c0244 100644 > --- a/kernel/cgroup_freezer.c > +++ b/kernel/cgroup_freezer.c > @@ -205,9 +205,12 @@ static void freezer_fork(struct cgroup_subsys *ss, struct task_struct *task) > * No lock is needed, since the task isn't on tasklist yet, > * so it can't be moved to another cgroup, which means the > * freezer won't be removed and will be valid during this > - * function call. > + * function call. Nevertheless, apply RCU read-side critical > + * section to suppress RCU lockdep false positives. > */ > + rcu_read_lock(); > freezer = task_freezer(task); > + rcu_read_unlock(); > > /* > * The root cgroup is non-freezable, so we can skip the > diff --git a/kernel/lockdep.c b/kernel/lockdep.c > index 2594e1c..03dd1fa 100644 > --- a/kernel/lockdep.c > +++ b/kernel/lockdep.c > @@ -3801,8 +3801,6 @@ void lockdep_rcu_dereference(const char *file, const int line) > { > struct task_struct *curr = current; > > - if (!debug_locks_off()) > - return; > printk("\n===================================================\n"); > printk( "[ INFO: suspicious rcu_dereference_check() usage. ]\n"); > printk( "---------------------------------------------------\n"); > diff --git a/kernel/sched.c b/kernel/sched.c > index 6af210a..14c44ec 100644 > --- a/kernel/sched.c > +++ b/kernel/sched.c > @@ -323,6 +323,15 @@ static inline struct task_group *task_group(struct task_struct *p) > /* Change a task's cfs_rq and parent entity if it moves across CPUs/groups */ > static inline void set_task_rq(struct task_struct *p, unsigned int cpu) > { > + /* > + * Strictly speaking this rcu_read_lock() is not needed since the > + * task_group is tied to the cgroup, which in turn can never go away > + * as long as there are tasks attached to it. > + * > + * However since task_group() uses task_subsys_state() which is an > + * rcu_dereference() user, this quiets CONFIG_PROVE_RCU. > + */ > + rcu_read_lock(); > #ifdef CONFIG_FAIR_GROUP_SCHED > p->se.cfs_rq = task_group(p)->cfs_rq[cpu]; > p->se.parent = task_group(p)->se[cpu]; > @@ -332,6 +341,7 @@ static inline void set_task_rq(struct task_struct *p, unsigned int cpu) > p->rt.rt_rq = task_group(p)->rt_rq[cpu]; > p->rt.parent = task_group(p)->rt_se[cpu]; > #endif > + rcu_read_unlock(); > } > > #else >
Hi Paul. Has this patch made it into the Linus tree? Thanks! Miles --
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:
INFO: suspicious rcu_dereference_check() usage - include/l ...
, Miles Lane
, (Sun Mar 7, 6:26 pm)
Re: INFO: suspicious rcu_dereference_check() usage - inclu ...
, Paul E. McKenney
, (Wed Mar 10, 8:28 pm)
Re: INFO: suspicious rcu_dereference_check() usage - incl ...
, Eric Paris
, (Mon Apr 12, 11:44 am)
Re: INFO: suspicious rcu_dereference_check() usage - incl ...
, Peter Zijlstra
, (Mon Apr 12, 11:47 am)
Re: INFO: suspicious rcu_dereference_check() usage - incl ...
, Peter Zijlstra
, (Wed Apr 14, 3:47 am)
Re: INFO: suspicious rcu_dereference_check() usage - inclu ...
, Paul E. McKenney
, (Wed Apr 14, 9:03 am)
Re: INFO: suspicious rcu_dereference_check() usage - inclu ...
, Paul E. McKenney
, (Thu Apr 15, 8:47 am)
Re: INFO: suspicious rcu_dereference_check() usage - inclu ...
, Lai Jiangshan
, (Sun Apr 18, 8:45 pm)
Re: INFO: suspicious rcu_dereference_check() usage - incl ...
, Eric Paris
, (Mon Apr 19, 11:26 am)
Re: INFO: suspicious rcu_dereference_check() usage - inclu ...
, Paul E. McKenney
, (Mon Apr 19, 4:01 pm)
Re: INFO: suspicious rcu_dereference_check() usage - inclu ...
, Eric Paris
, (Mon Apr 19, 6:25 pm)
Re: INFO: suspicious rcu_dereference_check() usage - inclu ...
, Paul E. McKenney
, (Mon Apr 19, 8:04 pm)
Re: INFO: suspicious rcu_dereference_check() usage - inclu ...
, Peter Zijlstra
, (Tue Apr 20, 12:21 am)
[PATCH] RCU: don't turn off lockdep when find suspicious r ...
, Lai Jiangshan
, (Tue Apr 20, 1:23 am)
Re: [PATCH] RCU: don't turn off lockdep when find suspicio ...
, Peter Zijlstra
, (Tue Apr 20, 1:36 am)
Re: [PATCH] RCU: don't turn off lockdep when find suspicio ...
, Eric Paris
, (Tue Apr 20, 5:31 am)
Re: [PATCH] RCU: don't turn off lockdep when find suspicio ...
, Paul E. McKenney
, (Tue Apr 20, 6:28 am)
Re: [PATCH] RCU: don't turn off lockdep when find suspicio ...
, Paul E. McKenney
, (Tue Apr 20, 6:52 am)
Re: [PATCH] RCU: don't turn off lockdep when find suspicio ...
, Miles Lane
, (Tue Apr 20, 8:38 am)
Re: INFO: suspicious rcu_dereference_check() usage - inclu ...
, Li Zefan
, (Tue Apr 20, 6:05 pm)
Re: INFO: suspicious rcu_dereference_check() usage - inclu ...
, Paul E. McKenney
, (Tue Apr 20, 8:14 pm)
Re: [PATCH] RCU: don't turn off lockdep when find suspicio ...
, Borislav Petkov
, (Tue Apr 20, 11:04 pm)
Re: [PATCH] RCU: don't turn off lockdep when find suspicio ...
, Paul E. McKenney
, (Wed Apr 21, 2:35 pm)
Re: [PATCH] RCU: don't turn off lockdep when find suspicio ...
, Paul E. McKenney
, (Wed Apr 21, 2:45 pm)
Re: [PATCH] RCU: don't turn off lockdep when find suspicio ...
, Paul E. McKenney
, (Wed Apr 21, 2:48 pm)
Re: [PATCH] RCU: don't turn off lockdep when find suspicio ...
, Eric Dumazet
, (Wed Apr 21, 2:57 pm)
Re: [PATCH] RCU: don't turn off lockdep when find suspicio ...
, Paul E. McKenney
, (Wed Apr 21, 3:14 pm)
Re: [PATCH] RCU: don't turn off lockdep when find suspicio ...
, Eric W. Biederman
, (Wed Apr 21, 4:26 pm)
Re: [PATCH] RCU: don't turn off lockdep when find suspicio ...
, Vivek Goyal
, (Thu Apr 22, 7:56 am)
Re: [PATCH] RCU: don't turn off lockdep when find suspicio ...
, Paul E. McKenney
, (Thu Apr 22, 9:01 am)
Re: [PATCH] RCU: don't turn off lockdep when find suspicio ...
, Miles Lane
, (Fri Apr 23, 5:50 am)
Re: [PATCH] RCU: don't turn off lockdep when find suspicio ...
, Paul E. McKenney
, (Fri Apr 23, 12:42 pm)
[PATCH v2.6.34-rc5 01/12] rcu: Fix RCU lockdep splat in se ...
, Paul E. McKenney
, (Fri Apr 23, 12:43 pm)
[PATCH v2.6.34-rc5 02/12] rcu: fix RCU lockdep splat on fr ...
, Paul E. McKenney
, (Fri Apr 23, 12:43 pm)
[PATCH v2.6.34-rc5 03/12] rcu: leave lockdep enabled after ...
, Paul E. McKenney
, (Fri Apr 23, 12:43 pm)
[PATCH v2.6.34-rc5 04/12] NFSv4: Fix the locking in nfs_in ...
, Paul E. McKenney
, (Fri Apr 23, 12:43 pm)
[PATCH v2.6.34-rc5 05/12] NFS: Fix RCU issues in the NFSv4 ...
, Paul E. McKenney
, (Fri Apr 23, 12:43 pm)
[PATCH v2.6.34-rc5 06/12] KEYS: Fix an RCU warning
, Paul E. McKenney
, (Fri Apr 23, 12:43 pm)
[PATCH v2.6.34-rc5 07/12] KEYS: Fix an RCU warning in the ...
, Paul E. McKenney
, (Fri Apr 23, 12:43 pm)
[PATCH v2.6.34-rc5 08/12] cgroup: Fix an RCU warning in cg ...
, Paul E. McKenney
, (Fri Apr 23, 12:43 pm)
[PATCH v2.6.34-rc5 09/12] cgroup: Fix an RCU warning in al ...
, Paul E. McKenney
, (Fri Apr 23, 12:43 pm)
[PATCH v2.6.34-rc5 10/12] sched: Fix an RCU warning in pri ...
, Paul E. McKenney
, (Fri Apr 23, 12:43 pm)
[PATCH v2.6.34-rc5 11/12] cgroup: Check task_lock in task_ ...
, Paul E. McKenney
, (Fri Apr 23, 12:43 pm)
[PATCH v2.6.34-rc5 12/12] memcg: css_id() must be called u ...
, Paul E. McKenney
, (Fri Apr 23, 12:43 pm)
Re: [PATCH] RCU: don't turn off lockdep when find suspicio ...
, Miles Lane
, (Fri Apr 23, 3:59 pm)
Re: [PATCH] RCU: don't turn off lockdep when find suspicio ...
, Miles Lane
, (Fri Apr 23, 10:35 pm)
Re: [PATCH] RCU: don't turn off lockdep when find suspicio ...
, Paul E. McKenney
, (Sat Apr 24, 7:34 pm)
Re: [PATCH] RCU: don't turn off lockdep when find suspicio ...
, Paul E. McKenney
, (Sat Apr 24, 7:36 pm)
Re: [PATCH] RCU: don't turn off lockdep when find suspicio ...
, Johannes Berg
, (Sun Apr 25, 12:45 am)
Re: [PATCH] RCU: don't turn off lockdep when find suspicio ...
, David Miller
, (Sun Apr 25, 12:49 am)
Re: [PATCH] RCU: don't turn off lockdep when find suspicio ...
, Miles Lane
, (Sun Apr 25, 8:49 am)
Re: [PATCH] RCU: don't turn off lockdep when find suspicio ...
, Miles Lane
, (Sun Apr 25, 1:20 pm)
Re: [PATCH] RCU: don't turn off lockdep when find suspicio ...
, Paul E. McKenney
, (Sun Apr 25, 7:07 pm)
Re: [PATCH] RCU: don't turn off lockdep when find suspicio ...
, Paul E. McKenney
, (Mon Apr 26, 9:09 am)
Re: [PATCH] RCU: don't turn off lockdep when find suspicio ...
, Eric W. Biederman
, (Mon Apr 26, 11:35 am)
Re: [PATCH] RCU: don't turn off lockdep when find suspicio ...
, Paul E. McKenney
, (Mon Apr 26, 9:27 pm)
Re: [PATCH] RCU: don't turn off lockdep when find suspicio ...
, Paul E. McKenney
, (Tue Apr 27, 9:22 am)
Re: [PATCH] RCU: don't turn off lockdep when find suspicio ...
, Eric Dumazet
, (Tue Apr 27, 9:33 am)
Re: [PATCH] RCU: don't turn off lockdep when find suspicio ...
, Miles Lane
, (Tue Apr 27, 10:58 am)
Re: [PATCH] RCU: don't turn off lockdep when find suspicio ...
, Paul E. McKenney
, (Tue Apr 27, 4:31 pm)
Re: [PATCH] RCU: don't turn off lockdep when find suspicio ...
, David Miller
, (Tue Apr 27, 4:42 pm)
Re: [PATCH] RCU: don't turn off lockdep when find suspicio ...
, Paul E. McKenney
, (Tue Apr 27, 4:52 pm)
Re: [PATCH] RCU: don't turn off lockdep when find suspicio ...
, Paul E. McKenney
, (Wed Apr 28, 2:37 pm)
Re: [PATCH] RCU: don't turn off lockdep when find suspicio ...
, Miles Lane
, (Sat May 1, 10:26 am)
Re: [PATCH] RCU: don't turn off lockdep when find suspicio ...
, Paul E. McKenney
, (Sat May 1, 2:55 pm)
Re: [PATCH] RCU: don't turn off lockdep when find suspicio ...
, Miles Lane
, (Sat May 1, 7:00 pm)
Re: [PATCH] RCU: don't turn off lockdep when find suspicio ...
, Paul E. McKenney
, (Sat May 1, 9:11 pm)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Kay Sievers
Re: char/tpm: tpm_infineon no longer loaded for HP 2510p laptop
Eric W. Biederman
[PATCH 8/8] sysfs: user namespaces: fix bug with clone(CLONE_NEWUSER) with fairsched
S K
Re: cpufreq doesn't seem to work in Intel Q9300
Bart Van Assche
Re: Is gcc thread-unsafe?
Greg Kroah-Hartman
[PATCH 20/36] Driver core: Call device_pm_add() after bus_add_device() in device_a...
git
:
Junio C Hamano
Re: git-svnimport
Junio C Hamano
Re: [PATCH] git-mv: Keep moved index entries inact
Johannes Schindelin
Re: [PATCH] Fix approxidate("never") to always return 0
A Large Angry SCM
Re: [RFC] origin link for cherry-pick and revert
Gabriel
[PATCH] When a remote is added but not fetched, tell the user.
linux-netdev
:
Daniel Lezcano
getsockopt(TCP_DEFER_ACCEPT) value change
David Miller
Re: 2.6.27.18: bnx2/tg3: BUG: "scheduling while atomic" trying to ifenslave a seco...
Ingo Molnar
Re: [regression] nf_iterate(), BUG: unable to handle kernel NULL pointer dereference
Eric W. Biederman
[PATCH 14/20] net: Simplify pppol2tp pernet operations.
Jeff Kirsher
[net-2.6 PATCH 2/5] e1000e: increase swflag acquisition timeout for ICHx/PCH
git-commits-head
:
Linux Kernel Mailing List
ath9k_htc: Allocate URBs properly
Linux Kernel Mailing List
sm501: add power control callback
Linux Kernel Mailing List
MIPS: Cavium: Remove unused watchdog code.
Linux Kernel Mailing List
V4L/DVB (8976): af9015: Add USB ID for AVerMedia A309
Linux Kernel Mailing List
ARM: 5670/1: bcmring: add default configuration for bcmring arch
openbsd-misc
:
daniele.pilenga
snmpd hangs on 4.1 looking up hrSWRunTable
Jason Dixon
Re: any web management gui for pf ?
Christophe Rioux
Implementation example of snmp
Nick Holland
Re: booting openbsd on eee without cd-rom
Bryan Irvine
Re: OpenBSD 4.7 Released, May 19 2010
Colocation donated by:
Syndicate