lkml.org 
[lkml]   [2023]   [Nov]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH v6 1/7] topology: Add a new arch_scale_freq_reference
On Tuesday 28 Nov 2023 at 15:52:52 (+0000), Ionela Voinescu wrote:
> Hi Vincent,
>
> I have a small request on this patch, which is useful for [1].
> I'll detail what is needed lower in the code.
>
> [1] https://lore.kernel.org/lkml/ZWYDr6JJJzBvsqf0@arm.com/
>
> On Thursday 09 Nov 2023 at 11:14:32 (+0100), Vincent Guittot wrote:
> > @@ -279,13 +278,13 @@ void topology_normalize_cpu_scale(void)
> >
> > capacity_scale = 1;
> > for_each_possible_cpu(cpu) {
> > - capacity = raw_capacity[cpu] * per_cpu(freq_factor, cpu);
> > + capacity = raw_capacity[cpu] * per_cpu(capacity_freq_ref, cpu);
>
> The only affected code that I could find is here and below.
>
> The above line would have to change to:
> capacity = raw_capacity[cpu] * per_cpu(capacity_freq_ref, cpu) ?: 1;
>
> > capacity_scale = max(capacity, capacity_scale);
> > }
> >
> > pr_debug("cpu_capacity: capacity_scale=%llu\n", capacity_scale);
> > for_each_possible_cpu(cpu) {
> > - capacity = raw_capacity[cpu] * per_cpu(freq_factor, cpu);
> > + capacity = raw_capacity[cpu] * per_cpu(capacity_freq_ref, cpu);
>
> and here:
> capacity = raw_capacity[cpu] * per_cpu(capacity_freq_ref, cpu) ?: 1;
>
> I think it's nicer to start with capacity_freq_ref as 0 and compensate here
> for uninitialized capacity_freq_ref.
>
> Let me know if this is alright of if you'd prefer us to make this change
> in a separate patch.
>
> Thanks,
> Ionela.
>

Correction - both will need to be:
capacity = raw_capacity[cpu] * (per_cpu(capacity_freq_ref, cpu) ?: 1);

Thanks,
Ionela.

\
 
 \ /
  Last update: 2023-11-28 17:00    [W:0.067 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site