lkml.org 
[lkml]   [2010]   [Dec]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [RFC][PATCH 07/17] sched: Serialize p->cpus_allowed and ttwu() using p->pi_lock
    On Fri, Dec 24, 2010 at 01:23:45PM +0100, Peter Zijlstra wrote:
    > Currently p->pi_lock already serializes p->sched_class, also put
    > p->cpus_allowed and try_to_wake_up() under it, this prepares the way
    > to do the first part of ttwu() without holding rq->lock.
    >
    > Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
    > ---
    > kernel/sched.c | 37 ++++++++++++++++---------------------
    > 1 file changed, 16 insertions(+), 21 deletions(-)
    >
    > Index: linux-2.6/kernel/sched.c
    > ===================================================================
    > --- linux-2.6.orig/kernel/sched.c
    > +++ linux-2.6/kernel/sched.c
    > @@ -2301,7 +2301,7 @@ void task_oncpu_function_call(struct tas
    >
    > #ifdef CONFIG_SMP
    > /*
    > - * ->cpus_allowed is protected by either TASK_WAKING or rq->lock held.
    > + * ->cpus_allowed is protected by both rq->lock and p->pi_lock
    > */
    > static int select_fallback_rq(int cpu, struct task_struct *p)
    > {
    > @@ -2334,7 +2334,7 @@ static int select_fallback_rq(int cpu, s
    > }
    >
    > /*
    > - * The caller (fork, wakeup) owns TASK_WAKING, ->cpus_allowed is stable.
    > + * The caller (fork, wakeup) owns p->pi_lock, ->cpus_allowed is stable.

    Yes for wakeup, but not true for fork.
    I don't see protection in wake_up_new_task().
    Or am I missing something?

    Thanks,
    Yong


    \
     
     \ /
      Last update: 2010-12-29 15:23    [W:4.493 / U:0.020 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site