• T
    sched: Use rcu in sched_get/set_affinity() · 23f5d142
    Thomas Gleixner 提交于
    tasklist_lock is held read locked to protect the
    find_task_by_vpid() call and to prevent the task going away.
    sched_setaffinity acquires a task struct ref and drops tasklist
    lock right away. The access to the cpus_allowed mask is
    protected by rq->lock.
    
    rcu_read_lock() provides the same protection here.
    Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
    Cc: Peter Zijlstra <peterz@infradead.org>
    LKML-Reference: <20091209100706.789059966@linutronix.de>
    Signed-off-by: NIngo Molnar <mingo@elte.hu>
    23f5d142
sched.c 268.5 KB