aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTianchen Ding <dtcccc@linux.alibaba.com>2024-03-06 10:21:32 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-05-02 16:32:49 +0200
commitdc21662b5b3430d405fea5bb0d30eda4e85a59af (patch)
treec1806c65f4d0a3f743b2dccaaf10ee82508b8a83
parent73224a5d2180066c7fe05b4656647601ba08d588 (diff)
sched/eevdf: Always update V if se->on_rq when reweighting
[ Upstream commit 11b1b8bc2b98e21ddf47e08b56c21502c685b2c3 ] 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 <wuyun.abel@bytedance.com> Signed-off-by: Tianchen Ding <dtcccc@linux.alibaba.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Abel Wu <wuyun.abel@bytedance.com> Tested-by: K Prateek Nayak <kprateek.nayak@amd.com> Tested-by: Chen Yu <yu.c.chen@intel.com> Link: https://lore.kernel.org/r/20240306022133.81008-2-dtcccc@linux.alibaba.com Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--kernel/sched/fair.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 69fe62126a28..71e7cf6f77f6 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -3740,9 +3740,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);
}