5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Hui Su [ Upstream commit a0c755e574e37fddb59edf175f27dc3877e7fe23 ] accumulate_sum() computes the number of elapsed PELT periods in a u64 but returns u32. When the count is a multiple of 2^32, it is truncated to zero even though the PELT sums have been updated. The caller interprets zero as no period boundary crossed and skips recomputing the averages, leaving *_avg stale relative to *_sum. Return the period count as u64 so the caller can test it without truncation. Fixes: a481db34b9be ("sched/fair: Optimize ___update_sched_avg()") Signed-off-by: Hui Su Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Reviewed-by: Vincent Guittot Reviewed-by: Kayra Cizmeci Link: https://patch.msgid.link/20261023025207.2967903-1-sh_def@163.com Signed-off-by: Sasha Levin --- kernel/sched/pelt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/pelt.c b/kernel/sched/pelt.c index 2c613e1cff3af..c125dd58670e2 100644 --- a/kernel/sched/pelt.c +++ b/kernel/sched/pelt.c @@ -102,7 +102,7 @@ static u32 __accumulate_pelt_segments(u64 periods, u32 d1, u32 d3) * d1 y^p + 1024 \Sum y^n + d3 y^0 (Step 2) * n=1 */ -static __always_inline u32 +static __always_inline u64 accumulate_sum(u64 delta, struct sched_avg *sa, unsigned long load, unsigned long runnable, int running) { -- 2.53.0