sched: Fix switch_from_fair()
authorPeter Zijlstra <a.p.zijlstra@chello.nl>
Mon, 17 Jan 2011 16:03:27 +0000 (17:03 +0100)
committerIngo Molnar <mingo@elte.hu>
Wed, 26 Jan 2011 11:33:22 +0000 (12:33 +0100)
commitda7a735e51f9622eb3e1672594d4a41da01d7e4f
tree27623dcd39c52a80b79e0ee86ab426fc9c7e2b46
parenta8941d7ec81678fb69aea7183338175f112f3e0d
sched: Fix switch_from_fair()

When a task is taken out of the fair class we must ensure the vruntime
is properly normalized because when we put it back in it will assume
to be normalized.

The case that goes wrong is when changing away from the fair class
while sleeping. Sleeping tasks have non-normalized vruntime in order
to make sleeper-fairness work. So treat the switch away from fair as a
wakeup and preserve the relative vruntime.

Also update sysrq-n to call the ->switch_{to,from} methods.

Reported-by: Onkalo Samu <samu.p.onkalo@nokia.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
include/linux/sched.h
kernel/sched.c
kernel/sched_fair.c
kernel/sched_idletask.c
kernel/sched_rt.c
kernel/sched_stoptask.c