Linux Documentation
 help / color / mirror / Atom feed
From: Christian Loehle <christian.loehle@arm.com>
To: rafael@kernel.org
Cc: zhenglifeng1@huawei.com, zhongqiu.han@oss.qualcomm.com,
	viresh.kumar@linaro.org, linux-kernel@vger.kernel.org,
	linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-doc@vger.kernel.org,
	Mario Limonciello <mario.limonciello@amd.com>,
	K Prateek Nayak <kprateek.nayak@amd.com>,
	Huang Rui <ray.huang@amd.com>, Perry Yuan <perry.yuan@amd.com>,
	"Gautham R . Shenoy" <gautham.shenoy@amd.com>,
	Vanshidhar Konda <vanshikonda@os.amperecomputing.com>,
	Shubhang Kaushik <sh@gentwo.org>,
	Pierre Gondois <pierre.gondois@arm.com>,
	Beata Michalska <beata.michalska@arm.com>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Ionela Voinescu <ionela.voinescu@arm.com>,
	Sudeep Holla <sudeep.holla@kernel.org>,
	Lukasz Luba <lukasz.luba@arm.com>,
	Jeremy Linton <jeremy.linton@arm.com>,
	Peter Zijlstra <peterz@infradead.org>,
	jonathanh@nvidia.com, zhanjie9@hisilicon.com,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Randy Dunlap <rdunlap@infradead.org>,
	Christian Loehle <christian.loehle@arm.com>
Subject: [PATCH 0/3] cpufreq: Resolve CPPC frequencies to performance levels
Date: Tue, 29 Sep 2026 11:29:54 +0100	[thread overview]
Message-ID: <20260929102957.2591657-1-christian.loehle@arm.com> (raw)

For table-based cpufreq drivers, the core resolves requests to supported
frequency-table entries before governors such as schedutil compare them
with their cached target. Different kHz requests selecting the same entry
therefore need not reach the driver again.

Table-less cppc-cpufreq lacks this resolution: the core returns the requested
kHz value even if firmware exposes only a few CPPC performance levels.
Different requests can miss the governor's cache yet program the same
Desired Performance value. The tested ARM AGI CPU exposes only 61 levels,
with bounds visible at:

  /sys/devices/system/cpu/cpuX/acpi_cppc/{lowest,highest}_perf

Add ->resolve_freq() so table-less ->target() drivers can canonicalize
requests without constructing a frequency table. CPPC resolves requests
before sugov_update_next_freq(), allowing its existing cache to skip
equivalent requests. Raw limit notifications still trigger
reconsideration, but only changed resolved limits force a driver update.
Failed limit writes remain pending for retry.

Testing on an ARM AGI CPU (61 distinct CPPC levels) with schedutil gives
the following end-to-end results across 16 iterations:

  schbench -m 2 -t 31 -F 256 -n 5 -R 18000 -r 60 -w 20 -i 60

  metric                         baseline       resolve-freq      change
  median p99                    3364 us          3280 us          -2.5%
  mean of run p99s              3664.2 us        3299.0 us       -10.0%
  worst run p99                 4360 us          3500 us         -19.7%
  median throughput             16431.08 RPS     16460.69 RPS     +0.2%

In an instrumented run of the same workload, cppc_set_perf() calls fell
from 1,136,868 to 866,703, a 23.8% reduction.

Christian Loehle (3):
  cpufreq: Add a driver frequency resolution callback
  cpufreq: CPPC: Resolve frequencies to performance levels
  cpufreq: Skip updates for unchanged resolved limits

 Documentation/admin-guide/pm/cpufreq.rst |   4 +
 Documentation/cpu-freq/cpu-drivers.rst   |  19 ++
 drivers/cpufreq/cppc_cpufreq.c           | 257 +++++++++++++++++++++--
 drivers/cpufreq/cpufreq.c                |  99 +++++++--
 include/linux/cpufreq.h                  |  11 +
 kernel/sched/cpufreq_schedutil.c         |  19 +-
 6 files changed, 359 insertions(+), 50 deletions(-)


base-commit: 6375e61c01e93e35ee7acd336a689ac1fae4b509

             reply	other threads:[~2026-09-29 10:30 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-29 10:29 Christian Loehle [this message]
2026-09-29 10:29 ` [PATCH 1/3] cpufreq: Add a driver frequency resolution callback Christian Loehle
2026-10-02 10:20   ` Zhongqiu Han
2026-09-29 10:29 ` [PATCH 2/3] cpufreq: CPPC: Resolve frequencies to performance levels Christian Loehle
2026-10-02 12:29   ` Zhongqiu Han
2026-10-04 13:55     ` Zhongqiu Han
2026-10-06  1:14   ` Jeremy Linton
2026-10-07  2:03     ` Vanshidhar Konda
2026-09-29 10:29 ` [PATCH 3/3] cpufreq: Skip updates for unchanged resolved limits Christian Loehle
2026-10-02 12:46   ` Zhongqiu Han
2026-09-30 20:06 ` [PATCH 0/3] cpufreq: Resolve CPPC frequencies to performance levels Mario Limonciello
2026-10-01 10:34 ` Peter Zijlstra

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=20260929102957.2591657-1-christian.loehle@arm.com \
    --to=christian.loehle@arm.com \
    --cc=beata.michalska@arm.com \
    --cc=corbet@lwn.net \
    --cc=dietmar.eggemann@arm.com \
    --cc=gautham.shenoy@amd.com \
    --cc=ionela.voinescu@arm.com \
    --cc=jeremy.linton@arm.com \
    --cc=jonathanh@nvidia.com \
    --cc=kprateek.nayak@amd.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukasz.luba@arm.com \
    --cc=mario.limonciello@amd.com \
    --cc=perry.yuan@amd.com \
    --cc=peterz@infradead.org \
    --cc=pierre.gondois@arm.com \
    --cc=rafael@kernel.org \
    --cc=ray.huang@amd.com \
    --cc=rdunlap@infradead.org \
    --cc=sh@gentwo.org \
    --cc=skhan@linuxfoundation.org \
    --cc=sudeep.holla@kernel.org \
    --cc=vanshikonda@os.amperecomputing.com \
    --cc=vincent.guittot@linaro.org \
    --cc=viresh.kumar@linaro.org \
    --cc=zhanjie9@hisilicon.com \
    --cc=zhenglifeng1@huawei.com \
    --cc=zhongqiu.han@oss.qualcomm.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