Commit 650cad5
Peter Zijlstra
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: af4cf40 ("sched/fair: Add cfs_rq::avg_vruntime")
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>1 parent 2f2fc17 commit 650cad5
1 file changed
+9
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
664 | 664 | | |
665 | 665 | | |
666 | 666 | | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
667 | 671 | | |
668 | 672 | | |
669 | 673 | | |
| |||
677 | 681 | | |
678 | 682 | | |
679 | 683 | | |
680 | | - | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
681 | 688 | | |
| 689 | + | |
682 | 690 | | |
683 | 691 | | |
684 | 692 | | |
| |||
0 commit comments