Skip to content

Commit b097a6d

Browse files
Leo Yanpundiramit
authored andcommitted
cpufreq: schedutil: clamp util to CPU maximum capacity
The code is to get the CPU util by accumulate different scheduling classes and when the total util value is larger than CPU capacity then it clamps util to CPU maximum capacity. So we can get correct util value when use PELT signal but if with WALT signal it misses to clamp util value. On the other hand, WALT doesn't accumulate different class utilization but it needs to applying boost margin for WALT signal the CPU util value is possible to be larger than CPU capacity; so this patch is to always clamp util to CPU maximum capacity. Change-Id: I05481ddbf20246bb9be15b6bd21b6ec039015ea8 Signed-off-by: Leo Yan <leo.yan@linaro.org>
1 parent 32e281f commit b097a6d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

kernel/sched/cpufreq_schedutil.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,9 @@ static void sugov_get_util(unsigned long *util, unsigned long *max, u64 time)
216216

217217
*util = boosted_cpu_util(cpu);
218218
if (likely(use_pelt()))
219-
*util = min((*util + rt), max_cap);
219+
*util = *util + rt;
220220

221+
*util = min(*util, max_cap);
221222
*max = max_cap;
222223
}
223224

0 commit comments

Comments
 (0)