From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@elte.hu>,
linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
tglx@linutronix.de, daniel.blueman@gmail.com,
lizf@cn.fujitsu.com, miles.lane@gmail.com,
manfred@colorfullife.com
Subject: Re: [GIT PULL rcu/urgent] yet more lockdep-RCU splat fixes
Date: Wed, 16 Jun 2010 15:41:10 -0700 [thread overview]
Message-ID: <20100616224110.GI2457@linux.vnet.ibm.com> (raw)
In-Reply-To: <1276669431.1745.595.camel@laptop>
On Wed, Jun 16, 2010 at 08:23:51AM +0200, Peter Zijlstra wrote:
> On Wed, 2010-06-16 at 07:53 +0200, Ingo Molnar wrote:
> > * Paul E. McKenney <paulmck@linux.vnet.ibm.com> wrote:
> >
> > > Hello, Ingo,
> > >
> > > Here are a few more fixes for RCU-lockdep splats.
> > >
> > > git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-2.6-rcu.git rcu/urgent
> > >
> > > This is based off of v2.6.35-rc3.
> > >
> > > Thanx, Paul
> > >
> > > ------------------>
> > > Daniel J Blueman (1):
> > > rcu: fix lockdep splat in wake_affine()
> > >
> > > Paul E. McKenney (2):
> > > rcu: fix scope of wake_affine()'s new RCU read-side critical section
> > > idr: fix RCU lockdep splat in idr_get_next()
> > >
> > > kernel/sched_fair.c | 2 ++
> > > lib/idr.c | 4 ++--
> > > 2 files changed, 4 insertions(+), 2 deletions(-)
> >
> > Pulled, thanks a lot Paul!
>
> I'm not at all sure of those two wake_affine() ones..
Hello, Peter!
Here is the story as I understand it:
o wake_affine() calls task_group() and uses the resulting
pointer, for example, passing it to effective_load().
This pointer is to a struct task_group, which contains
a struct rcu_head, which is passed to call_rcu in
sched_destroy_group(). So some protection really is
needed -- or is it enough that wake_affine seems to be
invoked on the current task? If the latter, we would
need to add a "task == current" check to task_subsys_state().
o task_group() calls task_subsys_state(), returning a pointer to
the enclosing task_group structure.
o task_subsys_state() returns an rcu_dereference_check()ed
pointer. The caller must either be in an RCU read-side
critical section, hold the ->alloc_lock, or hold the
cgroup lock.
Now wake_affine() appears to be doing load calculations, so it does not
seem reasonable to acquire the lock. Hence the use of RCU.
So, what should we be doing instead? ;-)
Thanx, Paul
next prev parent reply other threads:[~2010-06-16 22:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-16 4:22 [GIT PULL rcu/urgent] yet more lockdep-RCU splat fixes Paul E. McKenney
2010-06-16 5:53 ` Ingo Molnar
2010-06-16 6:23 ` Peter Zijlstra
2010-06-16 22:41 ` Paul E. McKenney [this message]
2010-06-17 8:49 ` Peter Zijlstra
2010-06-22 20:44 ` Paul E. McKenney
2010-06-23 8:08 ` Peter Zijlstra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100616224110.GI2457@linux.vnet.ibm.com \
--to=paulmck@linux.vnet.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=daniel.blueman@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lizf@cn.fujitsu.com \
--cc=manfred@colorfullife.com \
--cc=miles.lane@gmail.com \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox