History

sched/uclamp: Fix iowait boost escaping uclamp restriction

iowait_boost signal is applied independently of util and doesn't take into account uclamp settings of the rq. An io heavy task that is capped by uclamp_max could still request higher frequency because sugov_iowait_apply() doesn't clamp the boost via uclamp_rq_util_with() like effective_cpu_util() does. Make sure that iowait_boost honours uclamp requests by calling uclamp_rq_util_with() when applying the boost.

Qais Yousef committed 4 years ago

Commit d37aee91 parent 7a17e1d1 file · +1 −0Browse files

Unified · Split

kernel/sched/cpufreq_schedutil.c+1−0
@@ -289,6 +289,7 @@ static void sugov_iowait_apply(struct sugov_cpu *sg_cpu, u64 time) · 288 unmodified lines
289289 * into the same scale so we can compare.
290290 */
291291 boost = (sg_cpu->iowait_boost * sg_cpu->max) >> SCHED_CAPACITY_SHIFT;
292+ boost = uclamp_rq_util_with(cpu_rq(sg_cpu->cpu), boost, NULL);
292293 if (sg_cpu->util < boost)
293294 sg_cpu->util = boost;
294295 }