]> git.ipfire.org Git - thirdparty/linux.git/commit
sched/fair: Fix cpu_util runnable_avg arithmetic
authorHongyan Xia <hongyan.xia@transsion.com>
Fri, 5 Jun 2026 09:43:39 +0000 (09:43 +0000)
committerPeter Zijlstra <peterz@infradead.org>
Tue, 9 Jun 2026 08:28:08 +0000 (10:28 +0200)
commit29922fdfc2a4008d66418bedd0ebf5038fc54efa
tree212d6ad6c8785c401fc9aafd13b029d9bb1932bd
parentf666241e6bd5d9a494beca982e1953208dce531c
sched/fair: Fix cpu_util runnable_avg arithmetic

If we take runnable_avg in max(runnable_avg, util_avg) in cpu_util(), we
should then add or subtract task runnable_avg, but the arithmetic below
is still with task util_avg. This mixes runnable_avg with util_avg which
is incorrect.

Fix by always doing arithmetic with runnable_avg and only take
max(runnable_avg, util_avg) at the last step.

Fixes: 7d0583cf9ec7 ("sched/fair, cpufreq: Introduce 'runnable boosting'")
Signed-off-by: Hongyan Xia <hongyan.xia@transsion.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org>
Link: https://patch.msgid.link/20260605094318.37931-1-hongyan.xia@transsion.com
kernel/sched/fair.c