Re: [PATCH v1] cpufreq: Make cpufreq_update_pressure() fall back to cpuinfo.max_freq

From: Ricardo Neri

Date: Wed Jul 08 2026 - 13:04:24 EST


On Tue, Jul 07, 2026 at 07:25:39PM +0200, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
>
> If arch_scale_freq_ref() is not defined for a given arch (like x86, for
> example), cpufreq_update_pressure() will always set cpufreq_pressure to
> zero for all CPUs in the system, which is generally problematic on
> systems with asymmetric capacity [1].
>
> However, in the absence of arch_scale_freq_ref(), it is reasonable
> to assume that cpuinfo.max_freq is the maximum sustainable frequency
> for the given cpufreq policy. Moreover, there are cases in which
> arch_scale_freq_ref() would need to be defined to return essentially
> the cpuinfo.max_freq value anyway (for example, intel_pstate on
> hybrid platforms).
>
> For the above reasons, update cpufreq_update_pressure() to fall back to
> using cpuinfo.max_freq as the reference frequency if zero is returned by
> arch_scale_freq_ref().
>
> Fixes: 75d659317bb1 ("cpufreq: Add a cpufreq pressure feedback for the scheduler")
> Link: https://lore.kernel.org/lkml/CAKfTPtBuRLfYNnR4w--cFZYZy-R8gaPEgVwCcaMmbCcJ2H-muQ@xxxxxxxxxxxxxx/ [1]

This patch achieves the desired behavior for cluster scheduling discussed
in [1]: tasks duly migrate from CPUs of which frequency has been capped.
Tasks spread once the frequency cap is removed.

Tested-by: Ricardo Neri <ricardo.neri-calderon@xxxxxxxxxxxxxxx> # cluster scheduling