Skip to content

Commit 5068d84

Browse files
RinHizakuraPeter Zijlstra
authored andcommitted
sched/fair: Update min_vruntime for reweight_entity() correctly
Since reweight_entity() may have chance to change the weight of cfs_rq->curr entity, we should also update_min_vruntime() if this is the case Fixes: eab03c2 ("sched/eevdf: Fix vruntime adjustment on reweight") Signed-off-by: Yiwei Lin <s921975628@gmail.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Abel Wu <wuyun.abel@bytedance.com> Link: https://lore.kernel.org/r/20231117080106.12890-1-s921975628@gmail.com
1 parent 0257e5a commit 5068d84

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

kernel/sched/fair.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3815,17 +3815,17 @@ static void reweight_entity(struct cfs_rq *cfs_rq, struct sched_entity *se,
38153815
enqueue_load_avg(cfs_rq, se);
38163816
if (se->on_rq) {
38173817
update_load_add(&cfs_rq->load, se->load.weight);
3818-
if (!curr) {
3819-
/*
3820-
* The entity's vruntime has been adjusted, so let's check
3821-
* whether the rq-wide min_vruntime needs updated too. Since
3822-
* the calculations above require stable min_vruntime rather
3823-
* than up-to-date one, we do the update at the end of the
3824-
* reweight process.
3825-
*/
3818+
if (!curr)
38263819
__enqueue_entity(cfs_rq, se);
3827-
update_min_vruntime(cfs_rq);
3828-
}
3820+
3821+
/*
3822+
* The entity's vruntime has been adjusted, so let's check
3823+
* whether the rq-wide min_vruntime needs updated too. Since
3824+
* the calculations above require stable min_vruntime rather
3825+
* than up-to-date one, we do the update at the end of the
3826+
* reweight process.
3827+
*/
3828+
update_min_vruntime(cfs_rq);
38293829
}
38303830
}
38313831

0 commit comments

Comments
 (0)