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, 17 Mar 2026 16:26:47 +0800 [thread overview]
Message-ID: <214213f5-6932-4ac7-8d4c-e4a994622890@huawei.com> (raw)
In-Reply-To: <uo46emkyvpr4lzvnbdlkcgdrkvdzolkwuiqqey3pu3j3qqrbqz@z5ezeqhowy5a>
On 3/17/2026 2:20 PM, Viresh Kumar wrote:
> On 13-03-26, 18:12, zhenglifeng (A) wrote:
>> Let's forget what happens on our platform. The current discussion is no
>> longer about applying this patchset. What I really want to discuss are two
>> questions:
>>
>> 1. Is the platform allowed to adjust to frequencies out of the limits?
>>
>> My answer is YES. policy->min and policy->max can be modified by the user.
>> policy->min can even be increased to be as large as policy->max. However,
>> due to some other limitations(temperature, power, current etc.), the
>> platform sometimes has to (secretly as you say) reduce the actual
>> frequency, inevitably falling below the OS's frequency limits.
>
> It is fine if you want to do that, just that you should use OS to make that
> change.
> - Update freq table to contain all valid frequencies (1/4 of min in you case).
> - Update policy->min to current min, so you don't go to those low frequencies.
> - Use freq qos or sysfs to change min/max when you want to go really low, like
> 1/4 of min.
>
>> I believe
>> this situation will occur not only on our platform. The OS should not treat
>> this situation as an anomaly, and leading to unpredictable behavior. The OS
>> should have the ability to self-regulate. I believe that your patch is for
>> this purpose.
>
> When the OS is kept in the dark about such a change, it needs to figure out a
> way to get back. That's all we are trying here.
I see. Then I think the point is how to let OS know when hardware change the
frequency. It's worth thinking about.
>
>> 2. Is it reasonable to update the target frequency when querying
>> cpuinfo_cur_freq?
>>
>> My answer is NO. The idea that "observation can affect the outcome" should
>> only apply in quantum mechanics. If querying cpuinfo_cur_freq results in an
>> update of the target frequency, it means that the target frequency should
>> indeed be updated, regardless of the query itself. So I think the best
>> approach is to handle this properly in gov_dbs_update(). But I am not sure
>> if obtaining the actual frequency in gov_dbs_update() will burden the task.
>
> Exactly the point. We have chosen to do this only when cpufreq core gets to know
> the real frequency. Reading current frequency is a time consuming process and we
> don't want to do it unnecessarily.
>
>> Perhaps this is why target freq updates are made when querying
>> cpuinfo_cur_freq now. But this does not mean that it is reasonable. It is
>> what you call a band-aid I think.
>
> Of course it is a band-aid. No doubt about that. It may not be the best way out,
> but it is how it is right now.
>
Thanks for the answer.
next prev parent reply other threads:[~2026-03-17 8:26 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)
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) [this message]
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=214213f5-6932-4ac7-8d4c-e4a994622890@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®