sched: Use rcu in sched_get/set_affinity()
authorThomas Gleixner <tglx@linutronix.de>
Wed, 9 Dec 2009 10:15:01 +0000 (10:15 +0000)
committerIngo Molnar <mingo@elte.hu>
Mon, 14 Dec 2009 16:11:35 +0000 (17:11 +0100)
commit23f5d142519621b16cf2b378cf8adf4dcf01a616
treec7907cb635ea1ad6cab71598d687b752c17adf37
parent5fe85be081edf0ac92d83f9c39e0ab5c1371eb82
sched: Use rcu in sched_get/set_affinity()

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: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
LKML-Reference: <20091209100706.789059966@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/sched.c