sched: Fix raciness in runqueue_is_locked()
commit89f19f04dc72363d912fd007a399cb10310eff6e
authorAndrew Morton <akpm@linux-foundation.org>
Sat, 19 Sep 2009 18:55:44 +0000 (19 11:55 -0700)
committerIngo Molnar <mingo@elte.hu>
Sun, 20 Sep 2009 18:00:32 +0000 (20 20:00 +0200)
treedaa64e5de98a668eed4a2ceeb6ca95c478be4053
parent3f04e8cd5b24727a2500f8ab8f3de730ba47b02c
sched: Fix raciness in runqueue_is_locked()

runqueue_is_locked() is unavoidably racy due to a poor interface design.
It does

cpu = get_cpu()
ret = some_perpcu_thing(cpu);
put_cpu(cpu);
return ret;

Its return value is unreliable.

Fix.

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <200909191855.n8JItiko022148@imap1.linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
include/linux/sched.h
kernel/sched.c
kernel/trace/trace.c