* [PATCH v2] cpufreq: CPPC: Enable boost by default when supported
@ 2026-10-22 7:59 Pengjie Zhang
2026-10-26 8:47 ` Pengjie Zhang
0 siblings, 1 reply; 2+ messages in thread
From: Pengjie Zhang @ 2026-10-22 7:59 UTC (permalink / raw)
To: rafael, viresh.kumar
Cc: linuxarm, zhanjie9, prime.zeng, wanghuiqiang, xuwei5,
zhenglifeng1, yubowen8, pierre.gondois, sumitg, linux-pm,
linux-kernel, zhangpengjie2, mojunjun4
The CPPC driver leaves boost disabled by default when Highest Performance
exceeds Nominal Performance. Userspace must explicitly enable boost
before governors can use the full advertised performance range.
Enable boost by default when at least one possible CPU reports support,
while users who prefer to stay within the sustained nominal limit can
still disable it via the boost knob without determining scaling_max_freq
for each policy.
Check the performance capabilities before registering the driver so that
the cpufreq core enables boost for each policy that supports it.
Signed-off-by: Pengjie Zhang <zhangpengjie2@huawei.com>
---
Changes in v2:
- Drop "even" and clarify the commit message (Christian).
- Link to v1: https://lore.kernel.org/all/20261015015812.867988-1-zhangpengjie2@huawei.com/
drivers/cpufreq/cppc_cpufreq.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c
index 80893844353c..0a4255a36f60 100644
--- a/drivers/cpufreq/cppc_cpufreq.c
+++ b/drivers/cpufreq/cppc_cpufreq.c
@@ -1052,6 +1052,25 @@ static struct cpufreq_driver cppc_cpufreq_driver = {
.name = "cppc_cpufreq",
};
+static void __init cppc_cpufreq_default_boost_init(void)
+{
+ struct cppc_perf_caps caps;
+ bool enable = false;
+ int cpu;
+
+ for_each_possible_cpu(cpu) {
+ if (cppc_get_perf_caps(cpu, &caps))
+ continue;
+
+ if (caps.highest_perf > caps.nominal_perf) {
+ enable = true;
+ break;
+ }
+ }
+
+ cppc_cpufreq_driver.boost_enabled = enable;
+}
+
static int __init cppc_cpufreq_init(void)
{
int ret;
@@ -1061,6 +1080,7 @@ static int __init cppc_cpufreq_init(void)
cppc_freq_invariance_init();
populate_efficiency_class();
+ cppc_cpufreq_default_boost_init();
ret = cpufreq_register_driver(&cppc_cpufreq_driver);
if (ret)
--
2.33.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH v2] cpufreq: CPPC: Enable boost by default when supported
2026-10-22 7:59 [PATCH v2] cpufreq: CPPC: Enable boost by default when supported Pengjie Zhang
@ 2026-10-26 8:47 ` Pengjie Zhang
0 siblings, 0 replies; 2+ messages in thread
From: Pengjie Zhang @ 2026-10-26 8:47 UTC (permalink / raw)
To: rafael, viresh.kumar
Cc: linuxarm, zhanjie9, prime.zeng, wanghuiqiang, xuwei5,
zhenglifeng1, yubowen8, pierre.gondois, sumitg, linux-pm,
linux-kernel, mojunjun4, Christian Loehle
+cc Christian Loehle
On 10/22/2026 3:59 PM, Pengjie Zhang wrote:
> The CPPC driver leaves boost disabled by default when Highest Performance
> exceeds Nominal Performance. Userspace must explicitly enable boost
> before governors can use the full advertised performance range.
>
> Enable boost by default when at least one possible CPU reports support,
> while users who prefer to stay within the sustained nominal limit can
> still disable it via the boost knob without determining scaling_max_freq
> for each policy.
>
> Check the performance capabilities before registering the driver so that
> the cpufreq core enables boost for each policy that supports it.
>
> Signed-off-by: Pengjie Zhang <zhangpengjie2@huawei.com>
> ---
> Changes in v2:
> - Drop "even" and clarify the commit message (Christian).
> - Link to v1: https://lore.kernel.org/all/20261015015812.867988-1-zhangpengjie2@huawei.com/
>
> drivers/cpufreq/cppc_cpufreq.c | 20 ++++++++++++++++++++
> 1 file changed, 20 insertions(+)
>
> diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c
> index 80893844353c..0a4255a36f60 100644
> --- a/drivers/cpufreq/cppc_cpufreq.c
> +++ b/drivers/cpufreq/cppc_cpufreq.c
> @@ -1052,6 +1052,25 @@ static struct cpufreq_driver cppc_cpufreq_driver = {
> .name = "cppc_cpufreq",
> };
>
> +static void __init cppc_cpufreq_default_boost_init(void)
> +{
> + struct cppc_perf_caps caps;
> + bool enable = false;
> + int cpu;
> +
> + for_each_possible_cpu(cpu) {
> + if (cppc_get_perf_caps(cpu, &caps))
> + continue;
> +
> + if (caps.highest_perf > caps.nominal_perf) {
> + enable = true;
> + break;
> + }
> + }
> +
> + cppc_cpufreq_driver.boost_enabled = enable;
> +}
> +
> static int __init cppc_cpufreq_init(void)
> {
> int ret;
> @@ -1061,6 +1080,7 @@ static int __init cppc_cpufreq_init(void)
>
> cppc_freq_invariance_init();
> populate_efficiency_class();
> + cppc_cpufreq_default_boost_init();
>
> ret = cpufreq_register_driver(&cppc_cpufreq_driver);
> if (ret)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-10-26 8:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-22 7:59 [PATCH v2] cpufreq: CPPC: Enable boost by default when supported Pengjie Zhang
2026-10-26 8:47 ` Pengjie Zhang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®