sched: Remove rq->clock coupling from set_task_cpu()
authorPeter Zijlstra <a.p.zijlstra@chello.nl>
Fri, 27 Nov 2009 13:12:25 +0000 (14:12 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 20 Sep 2010 20:17:58 +0000 (13:17 -0700)
commit55eedcb291d0c7dd1a56090f72c80360fbb40d2f
treea19c0376eb685eb544093390daf97a5bacd4223a
parent9c6abb9b9806aa822c1e3ad924434c42ce0206ef
sched: Remove rq->clock coupling from set_task_cpu()

commit 5afcdab706d6002cb02b567ba46e650215e694e8 upstream

set_task_cpu() should be rq invariant and only touch task state, it
currently fails to do so, which opens up a few races, since not all
callers hold both rq->locks.

Remove the relyance on rq->clock, as any site calling set_task_cpu()
should also do a remote clock update, which should ensure the observed
time between these two cpus is monotonic, as per
kernel/sched_clock.c:sched_clock_remote().

Therefore we can simply remove the clock_offset bits and be happy.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Mike Galbraith <efault@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
kernel/sched.c