Re: [PATCH v3 1/1] cpufreq: schedutil: Optimize operations with single CPU capacity lookup

From: Viresh Kumar
Date: Thu Dec 08 2022 - 18:41:25 EST


On 08-12-22, 16:02, Lukasz Luba wrote:
> @@ -332,12 +333,15 @@ static void sugov_update_single_freq(struct update_util_data *hook, u64 time,
> struct sugov_cpu *sg_cpu = container_of(hook, struct sugov_cpu, update_util);
> struct sugov_policy *sg_policy = sg_cpu->sg_policy;
> unsigned int cached_freq = sg_policy->cached_raw_freq;
> + unsigned long max_cap;
> unsigned int next_f;
>
> - if (!sugov_update_single_common(sg_cpu, time, flags))
> + max_cap = arch_scale_cpu_capacity(sg_cpu->cpu);

I will rather do this at all three locations:

unsigned long max_cap = arch_scale_cpu_capacity(sg_cpu->cpu);

--
viresh