Commit c70fc32
Peter Zijlstra
sched/fair: Adhere to place_entity() constraints
Mike reports that commit 6d71a9c ("sched/fair: Fix EEVDF entity
placement bug causing scheduling lag") relies on commit 4423af8
("sched/fair: optimize the PLACE_LAG when se->vlag is zero") to not
trip a WARN in place_entity().
What happens is that the lag of the very last entity is 0 per
definition -- the average of one element matches the value of that
element. Therefore place_entity() will match the condition skipping
the lag adjustment:
if (sched_feat(PLACE_LAG) && cfs_rq->nr_queued && se->vlag) {
Without the 'se->vlag' condition -- it will attempt to adjust the zero
lag even though we're inserting into an empty tree.
Notably, we should have failed the 'cfs_rq->nr_queued' condition, but
don't because they didn't get updated.
Additionally, move update_load_add() after placement() as is
consistent with other place_entity() users -- this change is
non-functional, place_entity() does not use cfs_rq->load.
Fixes: 6d71a9c ("sched/fair: Fix EEVDF entity placement bug causing scheduling lag")
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reported-by: Mike Galbraith <efault@gmx.de>
Signed-off-by: "Peter Zijlstra (Intel)" <peterz@infradead.org>
Signed-off-by: Mike Galbraith <efault@gmx.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/c216eb4ef0e0e0029c600aefc69d56681cee5581.camel@gmx.de1 parent 44671e2 commit c70fc32
1 file changed
+3
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3795 | 3795 | | |
3796 | 3796 | | |
3797 | 3797 | | |
| 3798 | + | |
3798 | 3799 | | |
3799 | 3800 | | |
3800 | 3801 | | |
| |||
3821 | 3822 | | |
3822 | 3823 | | |
3823 | 3824 | | |
3824 | | - | |
3825 | 3825 | | |
| 3826 | + | |
3826 | 3827 | | |
3827 | 3828 | | |
| 3829 | + | |
3828 | 3830 | | |
3829 | 3831 | | |
3830 | 3832 | | |
| |||
0 commit comments