]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
sched/eevdf: Fix miscalculation in reweight_entity() when se is not curr
authorTianchen Ding <dtcccc@linux.alibaba.com>
Wed, 6 Mar 2024 02:21:33 +0000 (10:21 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 May 2024 14:32:49 +0000 (16:32 +0200)
commit2cf53d801da728968b762299068868c13478df94
tree1890b1efbfe9e3a9f9f37e38b9b25370de7c8667
parentdc21662b5b3430d405fea5bb0d30eda4e85a59af
sched/eevdf: Fix miscalculation in reweight_entity() when se is not curr

[ Upstream commit afae8002b4fd3560c8f5f1567f3c3202c30a70fa ]

reweight_eevdf() only keeps V unchanged inside itself. When se !=
cfs_rq->curr, it would be dequeued from rb tree first. So that V is
changed and the result is wrong. Pass the original V to reweight_eevdf()
to fix this issue.

Fixes: eab03c23c2a1 ("sched/eevdf: Fix vruntime adjustment on reweight")
Signed-off-by: Tianchen Ding <dtcccc@linux.alibaba.com>
[peterz: flip if() condition for clarity]
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Abel Wu <wuyun.abel@bytedance.com>
Link: https://lkml.kernel.org/r/20240306022133.81008-3-dtcccc@linux.alibaba.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/sched/fair.c