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] [day] [month] [year] [list]
Message-Id: <20250419025504.9760-3-ricardo.neri-calderon@linux.intel.com>
Date: Fri, 18 Apr 2025 19:55:04 -0700
From: Ricardo Neri <ricardo.neri-calderon@...ux.intel.com>
To: Sudeep Holla <sudeep.holla@....com>,
	"Rafael J. Wysocki" <rafael@...nel.org>,
	Danilo Krummrich <dakr@...nel.org>,
	Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>,
	Len Brown <len.brown@...el.com>
Cc: linux-kernel@...r.kernel.org,
	linux-pm@...r.kernel.org,
	Ricardo Neri <ricardo.neri@...el.com>,
	Ricardo Neri <ricardo.neri-calderon@...ux.intel.com>
Subject: [PATCH 2/2] cpufreq: intel_pstate: Populate the cpu_capacity sysfs entries

Intel hybrid processors have CPUs of different capacity. Populate the
interface /sys/devices/system/cpu/cpuN/cpu_capacity.

This interface uses the per-CPU variable `cpu_scale`. On x86 this variable
has no other use besides feeding the sysfs entries. Initialize it when
setting CPU capacity for the scheduler and scale-invariant code. Feed it
with arch_scale_cpu_capacity() as it gives capacity normalized to the
interval [0, SCHED_CAPACITY_SCALE].

Signed-off-by: Ricardo Neri <ricardo.neri-calderon@...ux.intel.com>
---
 drivers/cpufreq/intel_pstate.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index 4aad79d26c64..c32312843f19 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -952,6 +952,8 @@ static void hybrid_set_cpu_capacity(struct cpudata *cpu)
 			      cpu->capacity_perf,
 			      cpu->pstate.max_pstate_physical);
 
+	topology_set_cpu_scale(cpu->cpu, arch_scale_cpu_capacity(cpu->cpu));
+
 	pr_debug("CPU%d: perf = %u, max. perf = %u, base perf = %d\n", cpu->cpu,
 		 cpu->capacity_perf, hybrid_max_perf_cpu->capacity_perf,
 		 cpu->pstate.max_pstate_physical);
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ