From 971267e87b63e0a5aea009d81f3b5edb7e1ac0e4 Mon Sep 17 00:00:00 2001 From: Qais Yousef Date: Sun, 29 Oct 2023 19:44:52 +0100 Subject: [PATCH] schedutil : cap iowait boost by uclamp_max Which is a backport of upstream fix: d37aee9018e6 ("sched/uclamp: Fix iowait boost escaping uclamp restriction") Bug: 261695814 Signed-off-by: Qais Yousef Change-Id: Ibe8175edb9dea35e325f1a6f4306885ab8b6b28a --- kernel/sched/cpufreq_schedutil.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c index 45b20e519..530d79ec8 100755 --- a/kernel/sched/cpufreq_schedutil.c +++ b/kernel/sched/cpufreq_schedutil.c @@ -421,7 +421,10 @@ static unsigned long sugov_iowait_apply(struct sugov_cpu *sg_cpu, u64 time, * into the same scale so we can compare. */ boost = (sg_cpu->iowait_boost * max) >> SCHED_CAPACITY_SHIFT; - return max(boost, util); + boost = max(boost, util); + boost = uclamp_rq_util_with(cpu_rq(sg_cpu->cpu), boost, NULL); + + return boost; } #ifdef CONFIG_NO_HZ_COMMON