]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commit
sched: revert back to per-rq vruntime
authorPeter Zijlstra <a.p.zijlstra@chello.nl>
Fri, 17 Oct 2008 17:27:04 +0000 (19:27 +0200)
committerIngo Molnar <mingo@elte.hu>
Mon, 20 Oct 2008 12:05:04 +0000 (14:05 +0200)
commitf9c0b0950d5fd8c8c5af39bc061f27ea8fddcac3
tree288537eac8d5e03970422ac0c705617e551f544d
parenta4c2f00f5cb848af7a8c816426b413c8e41834df
sched: revert back to per-rq vruntime

Vatsa rightly points out that having the runqueue weight in the vruntime
calculations can cause unfairness in the face of task joins/leaves.

Suppose: dv = dt * rw / w

Then take 10 tasks t_n, each of similar weight. If the first will run 1
then its vruntime will increase by 10. Now, if the next 8 tasks leave after
having run their 1, then the last task will get a vruntime increase of 2
after having run 1.

Which will leave us with 2 tasks of equal weight and equal runtime, of which
one will not be scheduled for 8/2=4 units of time.

Ergo, we cannot do that and must use: dv = dt / w.

This means we cannot have a global vruntime based on effective priority, but
must instead go back to the vruntime per rq model we started out with.

This patch was lightly tested by doing starting while loops on each nice level
and observing their execution time, and a simple group scenario of 1:2:3 pinned
to a single cpu.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/sched_fair.c