lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250527-userspace-governor-doc-v2-1-0e22c69920f2@sony.com>
Date: Tue, 27 May 2025 21:59:09 +0900
From: Shashank Balaji <shashank.mahadasyam@...y.com>
To: "Rafael J. Wysocki" <rafael@...nel.org>, 
 Viresh Kumar <viresh.kumar@...aro.org>, Jonathan Corbet <corbet@....net>
Cc: linux-pm@...r.kernel.org, linux-doc@...r.kernel.org, 
 linux-kernel@...r.kernel.org, Shinya Takumi <shinya.takumi@...y.com>, 
 20250522-userspace-governor-doc-v1-1-c8a038e39084@...y.com, 
 Shashank Balaji <shashank.mahadasyam@...y.com>
Subject: [PATCH v2 1/2] cpufreq: userspace: set CPUFREQ_GOV_STRICT_TARGET
 flag

When the userspace governor is used, the user intends to set a fixed CPU
frequency for a policy, for whatever reason. The CPUFREQ_GOV_STRICT_TARGET
flag is the required behaviour. Without this flag, the intel_pstate driver,
with HWP enabled, will set HWP_MIN_PERF to the target frequency and HWP_MAX_PERF
to the policy maximum, when configuring the HWP_REQUEST MSR. This lets the
hardware choose any frequency between the target frequency and the policy
maximum, which is not the intended behaviour. To fix this,
`cat scaling_setspeed > scaling_max_freq` had to be done. With this patch, that
is no longer necessary. Setting scaling_setspeed is sufficient, as expected.

Signed-off-by: Shashank Balaji <shashank.mahadasyam@...y.com>
---
 drivers/cpufreq/cpufreq_userspace.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/cpufreq/cpufreq_userspace.c b/drivers/cpufreq/cpufreq_userspace.c
index 2c42fee76daa808f0cd1c7b1ab85476e695082e9..77d62152cd386d0eea69eba347b39f055ec860ce 100644
--- a/drivers/cpufreq/cpufreq_userspace.c
+++ b/drivers/cpufreq/cpufreq_userspace.c
@@ -134,6 +134,7 @@ static struct cpufreq_governor cpufreq_gov_userspace = {
 	.store_setspeed	= cpufreq_set,
 	.show_setspeed	= show_speed,
 	.owner		= THIS_MODULE,
+	.flags		= CPUFREQ_GOV_STRICT_TARGET,
 };
 
 MODULE_AUTHOR("Dominik Brodowski <linux@...do.de>, "

-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ