[lkml]   [2010]   [Jun]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [GIT PULL rcu/urgent] yet more lockdep-RCU splat fixes
    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 <>
    > Signed-off-by: Paul E. McKenney <>

    OK, fair enough, thanks!

     \ /
      Last update: 2010-06-23 10:11    [W:0.023 / U:2.032 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site