Peter Zijlstra 650cad561c 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: af4cf40470c2 ("sched/fair: Add cfs_rq::avg_vruntime")
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
2023-10-03 12:32:29 +02:00
..
2023-06-27 14:14:30 -07:00
2020-10-29 11:00:30 +01:00
2023-06-27 16:54:21 -07:00
2023-10-03 12:32:29 +02:00
2023-08-17 17:07:07 +02:00
2023-07-19 09:43:25 +02:00
2023-08-28 17:05:58 -07:00