Re: [PATCH v1 2/4] cpufreq: schedutil: Adjust utilization instead of frequency
From: Viresh Kumar
Date: Mon Dec 14 2020 - 06:08:24 EST
On 09-12-20, 16:32, Rafael J. Wysocki wrote:
> So I have misunderstood your example.
>
> In the non-invariant case (which is or shortly will be relevant for
> everybody interested) cpuinfo.max_freq goes into the calculation
> instead of the current frequency and the mapping between util and freq
> is linear. In the freq-dependent case it is not linear, of course.
>
> So I guess the concern is that this changes the behavior in the
> freq-dependent case which may not be desirable.
Right and we end up increasing the frequency here..
> Fair enough, but I'm not sure if that is enough of a reason to avoid
> sharing the code between the "perf" and "freq" paths.
Sure, I am not against sharing the code path, but all we need is
something like this here:
if (sugov_cpu_is_busy(sg_cpu) && sg_cpu->util < prev_util)
sg_cpu->util = prev_util;
else
next_f = get_next_freq(sg_policy, sg_cpu->util, sg_cpu->max);
i.e. we don't need to call get_next_freq() in this case at all.
--
viresh