Re: [PATCH] [RFC] sched: restrict iowait boost for boosted task only
From: Qais Yousef
Date: Sat Jan 25 2020 - 19:41:10 EST
On 01/25/20 23:59, Qais Yousef wrote:
> diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c
> index 9b8916fd00a2..a76c02eecdaf 100644
> --- a/kernel/sched/cpufreq_schedutil.c
> +++ b/kernel/sched/cpufreq_schedutil.c
> @@ -421,7 +421,8 @@ 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);
> + return uclamp_util_with(cpu_rq(sg_cpu->cpu), boost, NULL);
> }
>
> #ifdef CONFIG_NO_HZ_COMMON
Forgot to mention this will work if the background task is the only task
running on this CPU. Like Quentin already pointed out, the iowait_boost might
need more massaging to allow finer per task control.
--
Qais Yousef