mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jie Zhan <zhanjie9@hisilicon.com>
To: Xueqin Luo <luoxueqin@kylinos.cn>,
	Sudeep Holla <sudeep.holla@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J . Wysocki" <rafael@kernel.org>,
	Danilo Krummrich <dakr@kernel.org>,
	Viresh Kumar <viresh.kumar@linaro.org>
Cc: Lifeng Zheng <zhenglifeng1@huawei.com>,
	Pierre Gondois <pierre.gondois@arm.com>,
	Sumit Gupta <sumitg@nvidia.com>, <linux-kernel@vger.kernel.org>,
	<driver-core@lists.linux.dev>, <linux-pm@vger.kernel.org>
Subject: Re: [PATCH v5 0/3] cpufreq: cppc: Handle Highest Performance changes at runtime
Date: Mon, 7 Sep 2026 16:49:53 +0800	[thread overview]
Message-ID: <d02f335a-c97d-49ad-85c0-2eacd744eb0c@hisilicon.com> (raw)
In-Reply-To: <20260807060848.832929-1-luoxueqin@kylinos.cn>



On 8/7/2026 2:08 PM, Xueqin Luo wrote:
> Hi Rafael, Pierre,
> 
> 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 (e.g. due to
> thermal or power budget adjustments), 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.
Any real use case of this on platforms that run cppc_cpufreq drivers?
Some addtional motivation may help.

For example, a processor can age over time and its core frequency degrades.
It's good if platforms can make OSPM and userspace aware of this.
> 
> The series is split into three patches:
>   Patch 1: Core update_limits callback with boost QoS handling.
>   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.
> 
> v4 -> v5:
>   - Move cpu_data and caps pointer assignments after
>     guard(cpufreq_policy_write) in cppc_cpufreq_update_limits() to
>     avoid potential use-after-free if concurrent CPU offline frees
>     driver_data before the lock is acquired (Sashiko)
>   - Extract cppc_cpufreq_sync_boost_limits() from update_limits to
>     handle boost_supported re-evaluation, cpuinfo.max_freq tracking,
>     and boost_freq_req QoS update in a dedicated helper. The helper
>     always updates the QoS request (even when boost becomes
>     unsupported) to clear stale constraint values, and forcibly
>     disables boost_enabled when boost disappears at runtime
>   - Add highest_perf validation in topology_update_cpu_capacity():
>     reject values below lowest_perf to prevent corrupted register
>     reads from propagating into the scheduler capacity model
>   - Add early-return in topology_update_cpu_capacity() when
>     raw_capacity[cpu] is unchanged, avoiding redundant normalization
>     and schedule_work() calls
>   - Add zero capacity_scale guard in topology_update_cpu_capacity()
>     to prevent division by zero in the normalization loop
>   - Move guard(mutex) before the raw_capacity NULL check so that
>     the pointer read is protected by the lock
>   - Add CONFIG_GENERIC_ARCH_TOPOLOGY guard with no-op stub in
>     arch_topology.h for configs where the topology subsystem is
>     disabled
> 
> 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   |  76 ++++++++++++++++
>  drivers/cpufreq/cppc_cpufreq.c | 157 ++++++++++++++++++++++++++++++---
>  include/linux/arch_topology.h  |  13 +++
>  3 files changed, 233 insertions(+), 13 deletions(-)
> 

  parent reply	other threads:[~2026-09-07  8:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-07  6:08 Xueqin Luo
2026-08-07  6:08 ` [PATCH v5 1/3] cpufreq: cppc: Add update_limits support for Highest Performance changes Xueqin Luo
2026-09-07  8:43   ` Jie Zhan
2026-08-07  6:08 ` [PATCH v5 2/3] cpufreq: cppc: Refactor autonomous perf bounds into helper Xueqin Luo
2026-08-07  6:08 ` [PATCH v5 3/3] arch_topology: Add topology_update_cpu_capacity() for runtime updates Xueqin Luo
2026-08-10 14:33   ` Christian Loehle
2026-08-17 10:00     ` Xueqin Luo
2026-09-07  8:49 ` Jie Zhan [this message]
2026-09-21 19:47   ` [PATCH v5 0/3] cpufreq: cppc: Handle Highest Performance changes at runtime Christian Loehle
2026-09-22 10:57     ` Rafael J. Wysocki (Intel)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d02f335a-c97d-49ad-85c0-2eacd744eb0c@hisilicon.com \
    --to=zhanjie9@hisilicon.com \
    --cc=dakr@kernel.org \
    --cc=driver-core@lists.linux.dev \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=luoxueqin@kylinos.cn \
    --cc=pierre.gondois@arm.com \
    --cc=rafael@kernel.org \
    --cc=sudeep.holla@kernel.org \
    --cc=sumitg@nvidia.com \
    --cc=viresh.kumar@linaro.org \
    --cc=zhenglifeng1@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®