Linux Power Management development
 help / color / mirror / Atom feed
From: Pierre Gondois <pierre.gondois@arm.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: linux-kernel@vger.kernel.org, Jie Zhan <zhanjie9@hisilicon.com>,
	Lifeng Zheng <zhenglifeng1@huawei.com>,
	Ionela Voinescu <ionela.voinescu@arm.com>,
	Sumit Gupta <sumitg@nvidia.com>, Huang Rui <ray.huang@amd.com>,
	"Gautham R. Shenoy" <gautham.shenoy@amd.com>,
	Mario Limonciello <mario.limonciello@amd.com>,
	Perry Yuan <perry.yuan@amd.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
	Len Brown <lenb@kernel.org>,
	Saravana Kannan <saravanak@kernel.org>,
	linux-pm@vger.kernel.org
Subject: Re: [PATCH v6 3/4] cpufreq: Set policy->min and max as real QoS constraints
Date: Tue, 24 Mar 2026 12:40:01 +0100	[thread overview]
Message-ID: <ab06e8d6-d430-483b-a2a4-9e7d197aa6b6@arm.com> (raw)
In-Reply-To: <ukxdxr3xv7x6pqnwwafxgvhvfh5n7w67y3zwunhnk7b45tz3t6@d6ehl4vqac6t>


On 3/20/26 11:14, Viresh Kumar wrote:
> On 17-03-26, 11:17, Pierre Gondois wrote:
>> cpufreq_set_policy() will ultimately override the policy min/max
>> values written in the .init() callback through:
>> cpufreq_policy_online()
>> \-cpufreq_init_policy()
>>    \-cpufreq_set_policy()
>>      \-/* Set policy->min/max */
>> Thus the policy min/max values provided are only temporary.
> I am not comfortable with this patch to be honest. policy->min/max are used at
> so many places that it is really difficult to make sure if this patch will break
> something or not.
>
> For example:
>
> cpufreq_set_policy()
>   cpufreq_driver->verify()
>    cpufreq_frequency_table_verify()
>
> This uses min/max before it is set by the path you mentioned.
>
> I would suggest dropping this change, or most of it and doing only what is
> really required for this series.
>
Being able to set the min/max_freq_req from the driver might be
something that is needed, cf:
https://lore.kernel.org/lkml/20260213100633.15413-1-zhangpengjie2@huawei.com/

It would also allow to have a common way to set policy->min/max values
as they are set to the the cpuinfo.min/max_freq.

On the other hand I agree that I didn't test all the possible paths
for this change, so this is a bit audacious.


What about adding the following to have the values set for all drivers:

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c

index 70814c567243b..3a1e5f58a301f 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1530,6 +1530,9 @@ static int cpufreq_policy_online(struct 
cpufreq_policy *policy,
                                 CPUFREQ_CREATE_POLICY, policy);
         }

+       policy->max = policy->cpuinfo.max_freq;
+       policy->min = policy->cpuinfo.min_freq;
+
         if (cpufreq_driver->get && has_target()) {
                 policy->cur = cpufreq_driver->get(policy->cpu);
                 if (!policy->cur) {


  reply	other threads:[~2026-03-24 11:41 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-17 10:17 [PATCH v6 0/4] cpufreq: Introduce boost frequency QoS Pierre Gondois
2026-03-17 10:17 ` [PATCH v6 1/4] cpufreq: Remove per-CPU QoS constraint Pierre Gondois
2026-03-18 11:13   ` Viresh Kumar
2026-03-19  9:30     ` Pierre Gondois
2026-03-20  9:18       ` Viresh Kumar
2026-03-20  9:25         ` Viresh Kumar
2026-03-24 11:39         ` Pierre Gondois
2026-03-25  6:28           ` Viresh Kumar
2026-03-20 10:04       ` zhenglifeng (A)
2026-03-17 10:17 ` [PATCH v6 2/4] cpufreq: Add boost_freq_req QoS request Pierre Gondois
2026-03-18  2:50   ` zhenglifeng (A)
2026-03-18  7:56     ` Pierre Gondois
2026-03-17 10:17 ` [PATCH v6 3/4] cpufreq: Set policy->min and max as real QoS constraints Pierre Gondois
2026-03-20 10:14   ` Viresh Kumar
2026-03-24 11:40     ` Pierre Gondois [this message]
2026-03-25  6:49       ` Viresh Kumar
2026-03-25 16:54         ` Pierre Gondois
2026-03-26  4:26           ` Viresh Kumar
2026-03-17 10:17 ` [RFC PATCH v6 4/4] cpufreq/freq_table: Allow decreasing cpuinfo.max_freq Pierre Gondois
2026-03-20 10:58   ` Viresh Kumar

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=ab06e8d6-d430-483b-a2a4-9e7d197aa6b6@arm.com \
    --to=pierre.gondois@arm.com \
    --cc=gautham.shenoy@amd.com \
    --cc=ionela.voinescu@arm.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=rafael@kernel.org \
    --cc=ray.huang@amd.com \
    --cc=saravanak@kernel.org \
    --cc=srinivas.pandruvada@linux.intel.com \
    --cc=sumitg@nvidia.com \
    --cc=viresh.kumar@linaro.org \
    --cc=zhanjie9@hisilicon.com \
    --cc=zhenglifeng1@huawei.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