mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: K Prateek Nayak <kprateek.nayak@amd.com>
To: Hongyan Xia <hongyan.xia@transsion.com>,
	jong wu <jianyong.wu@outlook.com>
Cc: Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juri Lelli <juri.lelli@redhat.com>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	Zhongqiu Han <zhongqiu.han@oss.qualcomm.com>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"zhongyuan@hygon.cn" <zhongyuan@hygon.cn>,
	"huangsj@hygon.cn" <huangsj@hygon.cn>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	"Rafael J . Wysocki" <rafael@kernel.org>
Subject: Re: [PATCH] sched/fair: Only apply cpufreq pressure where frequency is invariant
Date: Wed, 9 Sep 2026 15:34:45 +0530	[thread overview]
Message-ID: <a2466e7d-2dd7-4de9-963f-6eb8c58d4a49@amd.com> (raw)
In-Reply-To: <a9dc111b-21cb-4bcb-ac91-f6be04bc2e06@transsion.com>

Hello Hongyan,

On 9/9/2026 9:39 AM, Hongyan Xia wrote:
>> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
>> index b898b6544069..97f4a3ba5107 100644
>> --- a/drivers/cpufreq/cpufreq.c
>> +++ b/drivers/cpufreq/cpufreq.c
>> @@ -2586,8 +2586,11 @@ static void cpufreq_update_pressure(struct cpufreq_policy *policy)
>>   
>>   	cpu = cpumask_first(policy->related_cpus);
>>   	max_freq = arch_scale_freq_ref(cpu);
>> -	if (!max_freq)
>> -		max_freq = policy->cpuinfo.max_freq;
>> +	if (!max_freq) {
>> +		max_freq = __resolve_freq(policy, policy->cpuinfo.max_freq,
>> +					  policy->cpuinfo.min_freq, policy->cpuinfo.max_freq,
>> +					  CPUFREQ_RELATION_H);
>> +	}
>>   
>>   	capped_freq = policy->max;
>>   
> 
> LGTM.

Thanks a ton for taking a look at the suggestion.

> 
> NIT: I do wonder if we need a full __resolve_freq() each time. We could 
> cache the highest achievable OPP on max_freq updates, but that's future 
> optimization.

Sure! We can cache it in the policy object during
cpufreq_policy_online().

Jianyong Wu would like to take a stab at it? If not, I can send it out
early next week.

-- 
Thanks and Regards,
Prateek

Disclaimer: Hygon emails are routed differently in our organization.
Response might be slightly delayed until my NNTP rule finds the email.
Sorry for any inconvenience.

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

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-21  7:39 Jianyong Wu
2026-08-21  9:26 ` Vincent Guittot
2026-08-24  3:44 ` Hongyan Xia
2026-08-24 13:06   ` Jianyong Wu
2026-08-25  7:40     ` Hongyan Xia
2026-09-02  9:00       ` jong wu
2026-08-25 13:05     ` Vincent Guittot
2026-09-02  8:49       ` jong wu
2026-09-02  9:37         ` Hongyan Xia
2026-09-03  2:04           ` jong wu
2026-09-07  2:32             ` Hongyan Xia
2026-09-07  8:07               ` K Prateek Nayak
2026-09-07  8:37                 ` K Prateek Nayak
2026-09-08  7:19                   ` jong wu
2026-09-09  4:09                   ` Hongyan Xia
2026-09-09 10:04                     ` K Prateek Nayak [this message]
2026-09-10  8:05                       ` Vincent Guittot
2026-09-10 11:59                         ` Jianyong Wu
2026-09-12  7:11                       ` Jianyong Wu
2026-09-07 14:57               ` jong wu

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=a2466e7d-2dd7-4de9-963f-6eb8c58d4a49@amd.com \
    --to=kprateek.nayak@amd.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=hongyan.xia@transsion.com \
    --cc=huangsj@hygon.cn \
    --cc=jianyong.wu@outlook.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rafael@kernel.org \
    --cc=vincent.guittot@linaro.org \
    --cc=viresh.kumar@linaro.org \
    --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®