]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commit
sched: more accurate min_vruntime accounting
authorPeter Zijlstra <a.p.zijlstra@chello.nl>
Fri, 24 Oct 2008 09:06:13 +0000 (11:06 +0200)
committerIngo Molnar <mingo@elte.hu>
Fri, 24 Oct 2008 10:51:00 +0000 (12:51 +0200)
commit1af5f730fc1bf7c62ec9fb2d307206e18bf40a69
tree6b9a1e5aa380abaaca68d3ba427ecec1a3b51a88
parent01c8c57d668d94f1036d9ab11a22aa24ca16a35d
sched: more accurate min_vruntime accounting

Mike noticed the current min_vruntime tracking can go wrong and skip the
current task. If the only remaining task in the tree is a nice 19 task
with huge vruntime, new tasks will be inserted too far to the right too,
causing some interactibity issues.

min_vruntime can only change due to the leftmost entry disappearing
(dequeue_entity()), or by the leftmost entry being incremented past the
next entry, which elects a new leftmost (__update_curr())

Due to the current entry not being part of the actual tree, we have to
compare the leftmost tree entry with the current entry, and take the
leftmost of these two.

So create a update_min_vruntime() function that takes computes the
leftmost vruntime in the system (either tree of current) and increases
the cfs_rq->min_vruntime if the computed value is larger than the
previously found min_vruntime. And call this from the two sites we've
identified that can change min_vruntime.

Reported-by: Mike Galbraith <efault@gmx.de>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Acked-by: Mike Galbraith <efault@gmx.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/sched_fair.c