From: Tianchen Ding Date: Wed, 6 Mar 2024 02:21:32 +0000 (+0800) Subject: sched/eevdf: Always update V if se->on_rq when reweighting X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=11b1b8bc2b98e21ddf47e08b56c21502c685b2c3;p=linux.git sched/eevdf: Always update V if se->on_rq when reweighting reweight_eevdf() needs the latest V to do accurate calculation for new ve and vd. So update V unconditionally when se is runnable. Fixes: eab03c23c2a1 ("sched/eevdf: Fix vruntime adjustment on reweight") Suggested-by: Abel Wu Signed-off-by: Tianchen Ding Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Abel Wu Tested-by: K Prateek Nayak Tested-by: Chen Yu Link: https://lore.kernel.org/r/20240306022133.81008-2-dtcccc@linux.alibaba.com --- diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 03be0d1330a6b..5551ce2af73e7 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -3790,9 +3790,8 @@ static void reweight_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, if (se->on_rq) { /* commit outstanding execution time */ - if (curr) - update_curr(cfs_rq); - else + update_curr(cfs_rq); + if (!curr) __dequeue_entity(cfs_rq, se); update_load_sub(&cfs_rq->load, se->load.weight); }