From: Peter Zijlstra <peterz@infradead.org>
To: paulmck@linux.vnet.ibm.com
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, 23 Jun 2010 10:08:47 +0200 [thread overview]
Message-ID: <1277280527.1875.782.camel@laptop> (raw)
In-Reply-To: <20100622204433.GJ2290@linux.vnet.ibm.com>
On Tue, 2010-06-22 at 13:44 -0700, Paul E. McKenney wrote:
> I am probably missing something, but I see wake_affine() only called
> from select_task_rq_fair(), which is one of the possible values for
> ->select_task_rq(). This can be called from select_task_rq(), which
> claims that it can be called without holding rq->lock. I do not see
> any rq->lock acquisition on the path from select_task_rq() to the
> call to wake_affine().
>
You're right, although try_to_wake_up(), wake_up_new_task() and
sched_exec() all hold a rq->lock (not sufficient to cover both
task_group() callers though).
I posted a patch yesterday that makes try_to_wake_up() call
select_task_rq() without any rq->lock held (although its a scary patch
and needs more work).
> rcu: apply RCU protection to wake_affine()
>
> The task_group() function returns a pointer that must be protected
> by either RCU, the ->alloc_lock, or the cgroup lock (see the
> rcu_dereference_check() in task_subsys_state(), which is invoked by
> task_group()). The wake_affine() function currently does none of these,
> which means that a concurrent update would be within its rights to free
> the structure returned by task_group(). Because wake_affine() uses this
> structure only to compute load-balancing heuristics, there is no reason
> to acquire either of the two locks.
>
> Therefore, this commit introduces an RCU read-side critical section that
> starts before the first call to task_group() and ends after the last use
> of the "tg" pointer returned from task_group(). Thanks to Li Zefan for
> pointing out the need to extend the RCU read-side critical section from
> that proposed by the original patch.
>
> Signed-off-by: Daniel J Blueman <daniel.blueman@gmail.com>
> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
OK, fair enough, thanks!
prev parent reply other threads:[~2010-06-23 8:09 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
2010-06-17 8:49 ` Peter Zijlstra
2010-06-22 20:44 ` Paul E. McKenney
2010-06-23 8:08 ` Peter Zijlstra [this message]
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=1277280527.1875.782.camel@laptop \
--to=peterz@infradead.org \
--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=paulmck@linux.vnet.ibm.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.