[PATCH v3 0/2] sched/cpufreq: fix schedutil's boost frequency handling

From: Ananthu C V

Date: Tue Sep 29 2026 - 07:40:24 EST


Schedutil's ability to reach boost frequencies depends on two values
being correct: policy max, which caps the resolved target frequency,
and the per-CPU capacity frequency reference, which anchors the
utilization-to-frequency mapping.

This series fixes a few gaps in how these values are maintained across
boost transitions:

The per-CPU capacity frequency reference is set once at policy
creation and never updated when boost is enabled afterwards, leaving
schedutil unable to target boost frequencies even at full utilization.
Introduce a helper cpufreq_frequency_table_max tp retrieve the highest
value listed in the frequency table and use the higher of it and cpuinfo
max_freq to seed capacity freq ref, letting it know the highest available
frequency from policy creation.

The generic boost callback only raises cpuinfo max, never lowers it.
Once boost is enabled, disabling it leaves cpuinfo max pinned at the
boost ceiling, keeping policy max stuck there too. Track the max
available non-boost frequency and use this in conjunction with the the
highest frequency retrieved from the table with cpufreq_frequency_table_max
to control boost frequencies when boost frequenies are available, allowing
the frequency to drop back to non boost values on boost disable. In
the absence of boost frequencies, the handling will fall back to using
cpuinfo->max_freq, preserving the current behaviour.

Oleg Keri tested the v2 on Lenovo Yoga Slim 7x Gen 11 and provided Tested-by,
but it is not picked up because of the implementation changes in v3.

Logs below for clear context:
Intermediate values from the time_in_state output and logs from bench
runs are truncated for brevity.

Before fix
----------
\# cd /sys/devices/system/cpu/cpufreq/
\# ls
boost policy0 policy12 policy6
\# cat boost
0
\# cat policy6/scaling_max_freq
4454400
\# echo 1 > boost
\# cat policy6/scaling_max_freq
4723200
\# echo 0 > boost
\# cat policy6/scaling_max_freq
4723200

\# echo 1 > boost
\# cat policy6/stats/time_in_state
355200 36958
4454400 650
4588800 0
4723200 0
\#

After fix
---------
\# cd /sys/devices/system/cpu/cpufreq/
\# ls
boost policy0 policy12 policy6
\# cat boost
0
\# cat policy6/scaling_max_freq
4454400
\# echo 1 > boost
\# cat policy6/scaling_max_freq
4723200
\# echo 0 > policy6/boost
\# cat policy6/scaling_max_freq
4454400

\# cat policy6/boost
0
\# cat policy6/stats/time_in_state
355200 40147
4454400 79
4588800 0
4723200 0
\# echo 1 > policy6/boost
\# cat policy6/stats/time_in_state
355200 44834
4454400 93
4588800 25
4723200 569

To: Vincent Guittot <vincent.guittot@xxxxxxxxxx>
To: Sudeep Holla <sudeep.holla@xxxxxxxxxx>
To: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
To: Rafael J. Wysocki <rafael@xxxxxxxxxx>
To: Danilo Krummrich <dakr@xxxxxxxxxx>
To: Viresh Kumar <viresh.kumar@xxxxxxxxxx>
To: Jie Zhan <zhanjie9@xxxxxxxxxxxxx>
To: Pierre Gondois <pierre.gondois@xxxxxxx>
Cc: linux-kernel@xxxxxxxxxxxxxxx
Cc: driver-core@xxxxxxxxxxxxxxx
Cc: linux-pm@xxxxxxxxxxxxxxx
Cc: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
Cc: Oleg Keri <okerixx@xxxxxxxxx>
Signed-off-by: Ananthu C V <ananthu.cv@xxxxxxxxxxxxxxxx>

Changes in v3:
- dropped max_table_freq field and added cpuinfo_frequency_table_max function to retrieve max
available freq instead
- changed the condition in policy_st_boost for not relying in cpuinfo max_freq to be whether
boost frequencies are available, instead of whether a freq table is present.
- changed fixes tag for second patch to Fixes: db80ad776cd2 ("cpufreq: Remove driver default
policy->min/max init") - thanks to Zhongqiu Han for the checks and suggestions
- Link to v2: https://lore.kernel.org/r/20260908-schedutil-boost-frequency-handling-v2-0-25312a713699@xxxxxxxxxxxxxxxx

Changes in v2:
- introduced max_table_freq/max_base_freq fields in cpufreq policy struct to use for seeding
capacity freq ref and handle frequency switching during boost cycling.
- does not try to update get_next_freq or drop the one way guard in cpufreq_frequency_table_cpuinfo
anymore
- Link to v1: https://lore.kernel.org/all/20260806044230.909961-1-sibi.sankar@xxxxxxxxxxxxxxxx/

---
Ananthu C V (2):
arch_topology: seed capacity_freq_ref with highest available frequency
cpufreq: fix policy max not returning to non-boost freq on boost disable

drivers/base/arch_topology.c | 3 ++-
drivers/cpufreq/cpufreq.c | 16 +++++++++++++++-
drivers/cpufreq/freq_table.c | 9 ++++++++-
include/linux/cpufreq.h | 16 ++++++++++++++++
4 files changed, 41 insertions(+), 3 deletions(-)
---
base-commit: a8c591ed6b672915e0be57843f943a2a723aff40
change-id: 20260804-schedutil-boost-frequency-handling-8e6bf2387a4a

Best regards,
--
Ananthu C V <ananthu.cv@xxxxxxxxxxxxxxxx>