Skip to content
Commit 650cad56 authored by Peter Zijlstra's avatar Peter Zijlstra
Browse files

sched/eevdf: Fix avg_vruntime()

The expectation is that placing a task at avg_vruntime() makes it
eligible. Turns out there is a corner case where this is not the case.

Specifically, avg_vruntime() relies on the fact that integer division
is a flooring function (eg. it discards the remainder). By this
property the value returned is slightly left of the true average.

However! when the average is a negative (relative to min_vruntime) the
effect is flipped and it becomes a ceil, with the result that the
returned value is just right of the average and thus not eligible.

Fixes: af4cf404

 ("sched/fair: Add cfs_rq::avg_vruntime")
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
parent 2f2fc17b
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment