mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Prashant Malani <pmalani@google.com>
To: open list <linux-kernel@vger.kernel.org>,
	 "open list:CPU FREQUENCY SCALING FRAMEWORK"
	<linux-pm@vger.kernel.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	 Viresh Kumar <viresh.kumar@linaro.org>
Cc: Beata Michalska <beata.michalska@arm.com>,
	Prashant Malani <pmalani@google.com>
Subject: [PATCH 2/2] cpufreq: CPPC: Don't verify cur frequency on governor start
Date: Sat, 23 Aug 2025 00:17:50 +0000	[thread overview]
Message-ID: <20250823001937.2765316-5-pmalani@google.com> (raw)
In-Reply-To: <20250823001937.2765316-1-pmalani@google.com>

Opt in to not verifying the policy's current frequency when the governor
starts. CPPC's get() function is known to return unreliable values,
so checking against that can mean the frequency gets set to the
unreliable value even though the governor (and user) didn't intend to do
so. That in turn causes unexpected performance drops.

Cc: Beata Michalska <beata.michalska@arm.com>
Signed-off-by: Prashant Malani <pmalani@google.com>
---
 drivers/cpufreq/cppc_cpufreq.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c
index 4a17162a392d..7fd6c03bb726 100644
--- a/drivers/cpufreq/cppc_cpufreq.c
+++ b/drivers/cpufreq/cppc_cpufreq.c
@@ -910,7 +910,8 @@ static struct freq_attr *cppc_cpufreq_attr[] = {
 };
 
 static struct cpufreq_driver cppc_cpufreq_driver = {
-	.flags = CPUFREQ_CONST_LOOPS | CPUFREQ_NEED_UPDATE_LIMITS,
+	.flags = CPUFREQ_CONST_LOOPS | CPUFREQ_NEED_UPDATE_LIMITS |
+		 CPUFREQ_DONT_VERIFY_FREQ_ON_GOVERNOR_START,
 	.verify = cppc_verify_policy,
 	.target = cppc_cpufreq_set_target,
 	.get = cppc_cpufreq_get_rate,
-- 
2.51.0.rc2.233.g662b1ed5c5-goog


      parent reply	other threads:[~2025-08-23  0:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-23  0:17 [PATCH 0/2] cpufreq: CPPC: Avoid cur frequency modification " Prashant Malani
2025-08-23  0:17 ` [PATCH 1/2] cpufreq: Add driver flag to avoid initial frequency verification Prashant Malani
2025-08-25  4:56   ` Viresh Kumar
2025-08-25  7:49     ` Beata Michalska
2025-08-23  0:17 ` Prashant Malani [this message]

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=20250823001937.2765316-5-pmalani@google.com \
    --to=pmalani@google.com \
    --cc=beata.michalska@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=viresh.kumar@linaro.org \
    /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®