Commit 66f21ee
sched/fair: Fix cpu_util runnable_avg arithmetic
[ Upstream commit 29922fd ]
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: 7d0583c ("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
Signed-off-by: Sasha Levin <sashal@kernel.org>1 parent 6abaa8e commit 66f21ee
1 file changed
Lines changed: 15 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7711 | 7711 | | |
7712 | 7712 | | |
7713 | 7713 | | |
| 7714 | + | |
| 7715 | + | |
7714 | 7716 | | |
7715 | 7717 | | |
7716 | 7718 | | |
7717 | 7719 | | |
7718 | | - | |
7719 | | - | |
7720 | | - | |
7721 | | - | |
7722 | | - | |
7723 | 7720 | | |
7724 | 7721 | | |
7725 | 7722 | | |
7726 | 7723 | | |
7727 | 7724 | | |
7728 | 7725 | | |
7729 | | - | |
7730 | | - | |
7731 | | - | |
| 7726 | + | |
7732 | 7727 | | |
| 7728 | + | |
| 7729 | + | |
| 7730 | + | |
| 7731 | + | |
| 7732 | + | |
| 7733 | + | |
| 7734 | + | |
| 7735 | + | |
| 7736 | + | |
| 7737 | + | |
| 7738 | + | |
| 7739 | + | |
7733 | 7740 | | |
7734 | 7741 | | |
7735 | 7742 | | |
| |||
0 commit comments