Re: [PATCH v2 1/2] arch_topology: seed capacity_freq_ref with boost-aware max freq
From: Rafael J. Wysocki (Intel)
Date: Thu Sep 17 2026 - 16:00:23 EST
On Tue, Sep 15, 2026 at 9:58 AM Vincent Guittot
<vincent.guittot@xxxxxxxxxx> wrote:
>
> On Tue, 8 Sept 2026 at 10:31, Ananthu C V <ananthu.cv@xxxxxxxxxxxxxxxx> wrote:
> >
> > capacity_freq_ref, the per-CPU frequency-invariance reference used by
> > schedutil, is seeded from policy->cpuinfo.max_freq at policy creation.
> > If boost frequencies are filtered out of the frequency table because
> > boost isn't yet enabled at boot, max_freq only reflects the non-boost
> > ceiling, so capacity_freq_ref never learns about boost frequencies for
> > the policy's lifetime. Enabling boost later raises policy->max, but
> > capacity_freq_ref stays stale, leaving schedutil unable to scale
> > utilization or target a frequency above the non-boost maximum.
> >
> > Track the highest frequency in the table regardless of boost state
> > (max_table_freq) and seed capacity_freq_ref with max(cpuinfo.max_freq,
> > max_table_freq), so the invariance reference is boost-aware from boot
> > regardless of whether boost is currently enabled. Runtime enforcement,
> > still handled by policy->max, is unaffected.
> >
> > Suggested-by: Vincent Guittot <vincent.guittot@xxxxxxxxxx>
> > Signed-off-by: Ananthu C V <ananthu.cv@xxxxxxxxxxxxxxxx>
> > ---
> > drivers/base/arch_topology.c | 3 ++-
> > drivers/cpufreq/freq_table.c | 6 ++++++
> > include/linux/cpufreq.h | 1 +
> > 3 files changed, 9 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c
> > index 8c5e47c28d9a..da94f77441da 100644
> > --- a/drivers/base/arch_topology.c
> > +++ b/drivers/base/arch_topology.c
> > @@ -404,7 +404,8 @@ 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(capacity_freq_ref, cpu) = policy->cpuinfo.max_freq;
> > + per_cpu(capacity_freq_ref, cpu) = max(policy->cpuinfo.max_freq,
> > + policy->cpuinfo.max_table_freq);
>
> I will let cpufreq maintainer comment about the need for a
> policy->cpuinfo.max_table_freq field or not
Well, there are cpufreq drivers that don't use frequency tables at
all, so I'd rather not add it.