mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v6 0/3] cpufreq: cppc: Handle Highest Performance changes at runtime
@ 2026-11-11  8:50 Xueqin Luo
  2026-11-11  8:50 ` [PATCH v6 1/3] cpufreq: cppc: Add update_limits support for Highest Performance changes Xueqin Luo
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Xueqin Luo @ 2026-11-11  8:50 UTC (permalink / raw)
  To: rafael, viresh.kumar, sudeep.holla
  Cc: zhanjie9, christian.loehle, zhenglifeng1, sumitg, lenb,
	maciej.wieczor-retman, pawel.chmielewski, gregkh, dakr, johan,
	ionela.voinescu, pierre.gondois, linux-pm, linux-acpi,
	linux-kernel, acpica-devel, driver-core, Xueqin Luo

Hi Rafael, Pierre, Christian, Jie,

This series adds support for handling ACPI CPPC Highest Performance
register changes at runtime, triggered by Notify(0x85) on a processor
device. When the platform changes the Highest Performance value, the
OSPM must re-evaluate the cached capability and propagate the change
to the cpufreq policy, the scheduler's CPU capacity model, and the
frequency invariance engine.

Concrete use cases discussed during review of the previous versions:

- A processor can age over time and its core frequency degrades. It
  is good if platforms can make OSPM and userspace aware of this
  (Jie, Christian).

- Platform operating mode changes between "performance" and
  "powersave" (longer battery life) when the top-most OPP is a
  high-cost one (Rafael).

The mode-switch use case can also move Highest Performance back up,
e.g. when switching from powersave back to performance. update_limits
therefore accepts changes in both directions, capped at the Highest
Performance probed at policy init, as proposed by Christian: any
value above the first probe is ignored, since it would allow boost
support to appear after policy init, which the cpufreq core cannot
handle today (the boost QoS request is only created at policy init).
A policy that started without boost cannot gain it at runtime;
supporting that would need runtime QoS request creation in the core
and is left for later.

v5 -> v6:

- Cap runtime Highest Performance changes at the value probed at
  policy init (Christian): any value above the first probe is
  ignored, since it would allow boost support to appear after policy
  init, which the cpufreq core cannot handle today (the boost QoS
  request is only created at policy init). Within that bound both
  decreases and increases are accepted, so a platform switching back
  to a performance mode restores the previous Highest Performance
  (Rafael's mode-switch use case).

- Refresh the topology capacity for every CPU of the policy
  (policy->related_cpus, covering offline CPUs of the domain as
  well) instead of only policy->cpu, so a shared-policy Notify(0x85)
  targeting any CPU of the policy refreshes the whole domain at
  once (Christian).

- Trim the internal helper comments (cppc_cpufreq_sync_boost_limits(),
  cppc_cpufreq_set_autonomous_perf()) down to the essential notes,
  drop the debug-only value dump, and report boost QoS sync failures
  through pr_err (Jie).

- Ignore values that would drop Highest Performance below Nominal:
  they violate the CPPC invariant and cannot be handled cleanly, so
  the special-casing for them is gone; such
  values are now warned about (Jie).
  topology_update_cpu_capacity() rejects such values as well, to
  match the boot-time validation.

- Return early from cppc_cpufreq_update_limits() when the policy is
  inactive: a concurrent CPU offline may have freed the driver data
  after cpufreq_update_limits() acquired the policy reference.

Note: proposed spec extensions would allow nominal_perf to change
at runtime [1] and introduce a highest_freq value; neither is
handled here.

[1] https://lore.kernel.org/all/20260430142430.755437-3-sumitg@nvidia.com/

The series is split into three patches:
  Patch 1: Core update_limits callback with boost QoS handling;
           runtime changes capped at the boot-probed value.
  Patch 2: Refactor autonomous perf bounds into a reusable helper
           and wire it into update_limits with error logging.
  Patch 3: Topology subsystem runtime capacity updates with
           validation, early-return optimization, and concurrent-safe
           normalization for all CPUs of the policy.

The v5 series was tested on an arm64 8-core big.LITTLE system with runtime
highest_perf changes injected through a debugfs hook that exercises
the same code path as ACPI Notify(0x85), including values above
1024 and full capacity re-normalization (see the v5 discussion for
the measured capacities).

Xueqin Luo (3):
  cpufreq: cppc: Add update_limits support for Highest Performance
    changes
  cpufreq: cppc: Refactor autonomous perf bounds into helper
  arch_topology: Add topology_update_cpu_capacity() for runtime updates

 drivers/base/arch_topology.c   |  77 ++++++++++++++++
 drivers/cpufreq/cppc_cpufreq.c | 157 ++++++++++++++++++++++++++++++---
 include/acpi/cppc_acpi.h       |   1 +
 include/linux/arch_topology.h  |  13 +++
 4 files changed, 235 insertions(+), 13 deletions(-)

Cc: Ionela Voinescu <ionela.voinescu@arm.com>

-- 
2.43.0

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-11-11 19:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-11  8:50 [PATCH v6 0/3] cpufreq: cppc: Handle Highest Performance changes at runtime Xueqin Luo
2026-11-11  8:50 ` [PATCH v6 1/3] cpufreq: cppc: Add update_limits support for Highest Performance changes Xueqin Luo
2026-11-11  8:50 ` [PATCH v6 2/3] cpufreq: cppc: Refactor autonomous perf bounds into helper Xueqin Luo
2026-11-11  8:50 ` [PATCH v6 3/3] arch_topology: Add topology_update_cpu_capacity() for runtime updates Xueqin Luo
2026-11-11 14:14   ` kernel test robot
2026-11-11 19:30   ` kernel test robot

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®