[PATCH] arm64: topology: Cleanup init_amu_fie() a bit

Viresh Kumar viresh.kumar at linaro.org
Thu Dec 10 07:34:39 EST 2020


On 10-12-20, 11:29, Ionela Voinescu wrote:
> On Thursday 10 Dec 2020 at 16:25:06 (+0530), Viresh Kumar wrote:
> > - But right after that we call static_branch_disable() if we aren't
> >   invariant (call to topology_scale_freq_invariant()), and this will
> >   happen if amu_fie_cpus doesn't have all the CPUs there. Isn't it? So
> >   partial amu support is already disallowed, without cpufreq.
> > 
> 
> This is the point that needs clarification:
> 
> topology_scale_freq_invariant()) = cpufreq_supports_freq_invariance() ||
>                                    arch_freq_counters_available(cpu_online_mask);
> 
> This checks if the full system is invariant.
> 
> The possible scenarios are:
> 
>  - All online CPUs support AMUs - arch_freq_counters_available() will
>    return true -> topology_scale_freq_invariant() will return true.
> 
>  - None of the CPUs support AMUs, or part of the CPUs support AMUs - the
>    system is invariant only if cpufreq is invariant (dependent on
>    whether the driver implements the proper callbacks that results in
>    calling arch_set_freq_scale() in cpufreq core.
> 
>  - Either cpufreq does not support invariance or we don't have AMU
>    support on all CPUs -> the system is not invariant so we disable
>    the AMU static key that guards the calls to
>    topology_scale_freq_tick() - we would not want to set a scale factor
>    for only a part of the CPUs.
> 
> So whether were are or are not invariant does not depend only on the AMU
> presence, but also on the cpufreq support for invariance. We have to
> disable invariance altogether (including the AMU guarding static key)
> if the system is not invariant (it no all CPUs have means to provide the
> scale).

Okay, I think I mis-assumed that amu_fie_cpus will get set by
enable_policy_freq_counters() even for CPUs where AMU support isn't
there, it won't be though.

Having said that, this patch, along with the minor suggestion in the
commit log, still stands fine, right ? The other patch which I sent is
probably incorrect due to the above assumption I had.

-- 
viresh



More information about the linux-arm-kernel mailing list