From: Jianyong Wu <wujianyong@hygon.cn>
To: Hongyan Xia <hongyan.xia@transsion.com>
Cc: "linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"ray.huang@amd.com" <ray.huang@amd.com>,
"mario.limonciello@amd.com" <mario.limonciello@amd.com>,
"perry.yuan@amd.com" <perry.yuan@amd.com>,
"zhanjie9@hisilicon.com" <zhanjie9@hisilicon.com>,
"zhenglifeng1@huawei.com" <zhenglifeng1@huawei.com>,
"pierre.gondois@arm.com" <pierre.gondois@arm.com>,
"sumitg@nvidia.com" <sumitg@nvidia.com>,
"srinivas.pandruvada@linux.intel.com"
<srinivas.pandruvada@linux.intel.com>,
"lenb@kernel.org" <lenb@kernel.org>,
"zhongqiu.han@oss.qualcomm.com" <zhongqiu.han@oss.qualcomm.com>,
"jianyong.wu@outlook.com" <jianyong.wu@outlook.com>,
Fengyu Wang <wangfengyu@hygon.cn>,
Yuan Zhong <zhongyuan@hygon.cn>, Huangsj <huangsj@hygon.cn>,
"rafael@kernel.org" <rafael@kernel.org>,
"viresh.kumar@linaro.org" <viresh.kumar@linaro.org>,
"kprateek.nayak@amd.com" <kprateek.nayak@amd.com>,
"vincent.guittot@linaro.org" <vincent.guittot@linaro.org>
Subject: RE: [PATCH] cpufreq: Use a non-boost reference frequency for pressure calculation
Date: Tue, 15 Sep 2026 12:46:14 +0000 [thread overview]
Message-ID: <0f30cfed358847e88f36f3833924dd25@hygon.cn> (raw)
In-Reply-To: <b10f5ad9-c91d-446d-a382-e6b2ce0ff7fb@transsion.com>
Hi Hongyan,
> -----Original Message-----
> From: Hongyan Xia <hongyan.xia@transsion.com>
> Sent: Tuesday, September 15, 2026 5:33 PM
> To: Jianyong Wu <wujianyong@hygon.cn>; rafael@kernel.org;
> viresh.kumar@linaro.org; kprateek.nayak@amd.com;
> vincent.guittot@linaro.org
> Cc: linux-pm@vger.kernel.org; linux-kernel@vger.kernel.org;
> ray.huang@amd.com; mario.limonciello@amd.com; perry.yuan@amd.com;
> zhanjie9@hisilicon.com; zhenglifeng1@huawei.com;
> pierre.gondois@arm.com; sumitg@nvidia.com;
> srinivas.pandruvada@linux.intel.com; lenb@kernel.org;
> zhongqiu.han@oss.qualcomm.com; jianyong.wu@outlook.com; Fengyu
> Wang <wangfengyu@hygon.cn>; Yuan Zhong <zhongyuan@hygon.cn>;
> Huangsj <huangsj@hygon.cn>
> Subject: Re: [PATCH] cpufreq: Use a non-boost reference frequency for
> pressure calculation
>
> On 9/15/2026 2:57 PM, Jianyong Wu wrote:
> > Commit d2d5c129d07e ("cpufreq: Make cpufreq_update_pressure() fall
> > back to cpuinfo.max_freq") introduced cpuinfo.max_freq as the reference
> > frequency for cpufreq pressure when arch_scale_freq_ref() returns zero.
> >
> > However, cpuinfo.max_freq may include boost frequencies and therefore
> > does not necessarily represent the maximum sustainable frequency. On
> > some systems using acpi-cpufreq, cpuinfo.max_freq includes boost while
> > the frequency table only contains non-boost frequencies. Consequently,
> > cpufreq pressure remains nonzero even without an additional frequency
> > limit.
> >
> > Furthermore, drivers may update cpuinfo.max_freq when boost is
> enabled
> > or disabled. With a fixed policy limit below the maximum non-boost
> > frequency, this changes the pressure reference and hence the reported
> > pressure, although the non-boost frequency limit remains unchanged.
> >
> > Add max_sustainable_freq to struct cpufreq_cpuinfo to provide a
> reference
> > frequency excluding boost. Populate it from the nominal frequency in
> > amd-pstate and cppc_cpufreq, the maximum non-turbo frequency in
> > intel_pstate, and the highest frequency-table entry in acpi-cpufreq.
> >
> > Use this value when arch_scale_freq_ref() returns zero. Preserve the
> > existing cpuinfo.max_freq fallback for drivers that leave the new field
> > at zero.
>
> Actually, what remaining platforms are out there that can hit this path?
> From a quick look I think no x86 or Arm platforms can hit the fallback.
>
Thanks for review!
There are many cpufreq drivers, and I don't have access to hardware covering
all of them. This patch therefore limits the changes to drivers relevant to
the reported issue.
Some legacy x86 drivers, such as pt-clockmod, do not populate the new field
and still use the fallback. The fallback preserves their existing behavior.
Support for the new field in other drivers can be added separately, after
verifying each driver's frequency semantics and validating the changes on
the relevant hardware.
Thanks
Jianyong
> > Tested with acpi-cpufreq, intel_pstate, and amd-pstate in active and
> > passive modes. With no additional frequency limit, pressure is zero.
> > With a fixed limit below the non-boost reference frequency, pressure
> > remains unchanged across boost transitions.
> >
> > Fixes: d2d5c129d07e ("cpufreq: Make cpufreq_update_pressure() fall
> back to cpuinfo.max_freq")
> > Signed-off-by: Jianyong Wu <wujianyong@hygon.cn>
>
> Looks okay to me.
>
> Reviewed-by: Hongyan Xia <hongyan.xia@transsion.com>
>
> > ---
> > [...]
next prev parent reply other threads:[~2026-09-15 12:46 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-15 6:57 Jianyong Wu
2026-09-15 9:32 ` Hongyan Xia
2026-09-15 12:46 ` Jianyong Wu [this message]
2026-09-17 17:38 ` Rafael J. Wysocki (Intel)
2026-09-17 18:34 ` Mario Limonciello
2026-09-18 5:59 ` Jianyong Wu
2026-09-18 4:08 ` Jianyong Wu
2026-09-18 18:19 ` Rafael J. Wysocki
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=0f30cfed358847e88f36f3833924dd25@hygon.cn \
--to=wujianyong@hygon.cn \
--cc=hongyan.xia@transsion.com \
--cc=huangsj@hygon.cn \
--cc=jianyong.wu@outlook.com \
--cc=kprateek.nayak@amd.com \
--cc=lenb@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mario.limonciello@amd.com \
--cc=perry.yuan@amd.com \
--cc=pierre.gondois@arm.com \
--cc=rafael@kernel.org \
--cc=ray.huang@amd.com \
--cc=srinivas.pandruvada@linux.intel.com \
--cc=sumitg@nvidia.com \
--cc=vincent.guittot@linaro.org \
--cc=viresh.kumar@linaro.org \
--cc=wangfengyu@hygon.cn \
--cc=zhanjie9@hisilicon.com \
--cc=zhenglifeng1@huawei.com \
--cc=zhongqiu.han@oss.qualcomm.com \
--cc=zhongyuan@hygon.cn \
/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®