• Thomas Gleixner's avatar
    sched: Use rcu in sched_get/set_affinity() · 23f5d142
    Thomas Gleixner authored
    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: default avatarThomas Gleixner <tglx@linutronix.de>
    Cc: Peter Zijlstra <peterz@infradead.org>
    LKML-Reference: <20091209100706.789059966@linutronix.de>
    Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
    23f5d142
sched.c 269 KB