lkml.org 
[lkml]   [2021]   [Nov]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] base: arch_topology: Use policy->max to calculate freq_factor
From
Date


On 11/17/21 10:12 AM, Lukasz Luba wrote:
>
>
> On 11/15/21 8:10 PM, Thara Gopinath wrote:
>> cpuinfo.max_freq can reflect boost frequency if enabled during boot.
>> Since
>> we don't consider boost frequencies while calculating cpu capacities, use
>> policy->max to populate the freq_factor during boot up.
>>
>> Signed-off-by: Thara Gopinath <thara.gopinath@linaro.org>
>> ---
>>   drivers/base/arch_topology.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c
>> index 43407665918f..df818b439bc3 100644
>> --- a/drivers/base/arch_topology.c
>> +++ b/drivers/base/arch_topology.c
>> @@ -334,7 +334,7 @@ init_cpu_capacity_callback(struct notifier_block *nb,
>>       cpumask_andnot(cpus_to_visit, cpus_to_visit, policy->related_cpus);
>>       for_each_cpu(cpu, policy->related_cpus)
>> -        per_cpu(freq_factor, cpu) = policy->cpuinfo.max_freq / 1000;
>> +        per_cpu(freq_factor, cpu) = policy->max / 1000;
>>       if (cpumask_empty(cpus_to_visit)) {
>>           topology_normalize_cpu_scale();
>>
>
> LGTM
>
> Reviewed-by: Lukasz Luba <lukasz.luba@armc.com>

Rafael, Thara, please ignore for a while this review.
We are going to do full investigation of this boost frequency,
capacity, schedutil util-to-freq mapping with cpuinfo.max_freq.
The code pointed by Rafael in that sched_util function
already has issue [1]. We have to figure out the consistent
solution for all platforms.

Regards,
Lukasz

[1]
https://elixir.bootlin.com/linux/v5.16-rc2/source/kernel/sched/cpufreq_schedutil.c#L152

\
 
 \ /
  Last update: 2021-11-24 17:23    [W:0.139 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site