From: "zhenglifeng (A)" <zhenglifeng1@huawei.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>, <mingo@redhat.com>,
<peterz@infradead.org>, <juri.lelli@redhat.com>,
<vincent.guittot@linaro.org>, <dietmar.eggemann@arm.com>,
<rostedt@goodmis.org>, <bsegall@google.com>, <mgorman@suse.de>,
<vschneid@redhat.com>, <linux-pm@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <linuxarm@huawei.com>,
<jonathan.cameron@huawei.com>, <zhanjie9@hisilicon.com>,
<lihuisong@huawei.com>, <yubowen8@huawei.com>,
<zhangpengjie2@huawei.com>, <wangzhi12@huawei.com>,
<linhongye@h-partners.com>
Subject: Re: [PATCH 0/2] cpufreq: governor: Apply limits with target_freq instead of policy->cur
Date: Tue, 10 Mar 2026 21:11:45 +0800 [thread overview]
Message-ID: <b7d3819f-168a-48f7-99f2-2ba04dec77e6@huawei.com> (raw)
In-Reply-To: <utvxk3rn6icadx4llmzfu32auqk4ql7rckh7kxtgdgmtoyovqz@vo2lmhip5vk7>
On 3/10/2026 12:29 PM, Viresh Kumar wrote:
> On 10-03-26, 10:22, zhenglifeng (A) wrote:
>> In the example I showed above, policy->cur will become 1GHz when someone
>> query cpuinfo_cur_freq, because the real freq is 500MHz. After that,
>> conservative governor has to take some time to get to the max freq again
>> step by step in your code.
>
> The problem is that your platform is doing some tricky stuff (by
> changing the frequency for some reason) and it expects the governor to
> still work the same. The software is trying to get a target frequency
> based on an algorithm and you are ending up breaking it. If this is
> software controlled (instead of hardware), I think a better solution
> is to play with QoS requests and limit the policy->max frequency, so
> the cpufreq core remains in sync instead of reducing the underlying
> frequency without informing the software. All cpufreq core can do now
> is go adjust based on what you are doing. Yes, conservative governor
> will start again from scratch here but this is what you are doing
> anyways. Either, don't change the underlying freq or use a different
> governor. I don't know how this can be fixed otherwise.
>
>> I still believe using policy->cur to update target in
>> cpufreq_policy_apply_limits() is not very reasonable, because OS never
>> knows what the platform will do to affect the final frequency.
>
> The software is doing the right thing by using the cached current
> frequency (best known to it).
>
> We are using policy->cur at too many places and we will not be able to
> change all of them assuming the hardware is not in sync with the
> request made earlier. The change you propose may fix your issue for
> time being, but it is just a band-aid which I don't want to apply.
> When the hardware changes underlying freq, there are far too many
> things broken elsewhere too.
>
I basically agree with what you said. But I have a little question. Do you
think the target freq should be updated when querying cpuinfo_cur_freq? I
think it should only be updated by governor or when limits changed.
next prev parent reply other threads:[~2026-03-10 13:11 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-10 11:54 Lifeng Zheng
2026-02-10 11:54 ` [PATCH 1/2] cpufreq: governor: Move requested_freq to policy_dbs_info Lifeng Zheng
2026-02-10 11:54 ` [PATCH 2/2] cpufreq: governor: Apply limits with requested_freq or next_freq Lifeng Zheng
2026-03-05 6:21 ` Viresh Kumar
2026-03-06 4:08 ` zhenglifeng (A)
2026-03-05 12:19 ` [PATCH 0/2] cpufreq: governor: Apply limits with target_freq instead of policy->cur Jie Zhan
2026-03-06 9:21 ` zhenglifeng (A)
2026-03-10 3:14 ` Jie Zhan
2026-03-09 8:27 ` Viresh Kumar
2026-03-09 12:32 ` Rafael J. Wysocki
2026-03-10 2:22 ` zhenglifeng (A)
2026-03-10 4:29 ` Viresh Kumar
2026-03-10 13:11 ` zhenglifeng (A) [this message]
2026-03-12 6:16 ` Viresh Kumar
2026-03-13 3:51 ` zhenglifeng (A)
2026-03-13 6:05 ` Viresh Kumar
2026-03-13 10:12 ` zhenglifeng (A)
2026-03-17 6:20 ` Viresh Kumar
2026-03-17 8:26 ` zhenglifeng (A)
2026-03-17 10:26 ` 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=b7d3819f-168a-48f7-99f2-2ba04dec77e6@huawei.com \
--to=zhenglifeng1@huawei.com \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=jonathan.cameron@huawei.com \
--cc=juri.lelli@redhat.com \
--cc=lihuisong@huawei.com \
--cc=linhongye@h-partners.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rafael@kernel.org \
--cc=rostedt@goodmis.org \
--cc=vincent.guittot@linaro.org \
--cc=viresh.kumar@linaro.org \
--cc=vschneid@redhat.com \
--cc=wangzhi12@huawei.com \
--cc=yubowen8@huawei.com \
--cc=zhangpengjie2@huawei.com \
--cc=zhanjie9@hisilicon.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®