[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20260128031521.389765-1-tianyaxiong@kylinos.cn>
Date: Wed, 28 Jan 2026 11:15:21 +0800
From: Yaxiong Tian <tianyaxiong@...inos.cn>
To: rafael@...nel.org,
srinivas.pandruvada@...ux.intel.com,
lenb@...nel.org,
viresh.kumar@...aro.org,
ricardo.neri-calderon@...ux.intel.com
Cc: linux-pm@...r.kernel.org,
linux-kernel@...r.kernel.org,
Yaxiong Tian <tianyaxiong@...inos.cn>
Subject: [PATCH] cpufreq: intel_pstate: Enable asym capacity only when cpu smt is not possible
According to the description in the intel_pstate.rst documentation,
Capacity-Aware Scheduling and Energy-Aware Scheduling are only
supported on a hybrid processor without SMT. Previously, the system
used sched_smt_active() for judgment, which is not a strict condition
because users can switch it on or off via /sys at any time.
This could lead to incorrect driver settings in certain scenarios.
For example, on a CPU that supports SMT, a user can disable SMT
via the nosmt parameter to enable asym capacity, and then re-enable
SMT via /sys. In such cases, some settings in the driver would no
longer be correct.
To address this issue, replace sched_smt_active() with cpu_smt_possible(),
and only enable asym capacity when cpu smt is not possible.
Fixes: 929ebc93ccaa ("cpufreq: intel_pstate: Set asymmetric CPU capacity on hybrid systems")
Signed-off-by: Yaxiong Tian <tianyaxiong@...inos.cn>
---
drivers/cpufreq/intel_pstate.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index ec4abe374573..8105c41861a3 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -1142,8 +1142,11 @@ static void hybrid_refresh_cpu_capacity_scaling(void)
static void hybrid_init_cpu_capacity_scaling(bool refresh)
{
- /* Bail out if enabling capacity-aware scheduling is prohibited. */
- if (no_cas)
+ /*
+ * Bail out if capacity-aware scheduling is prohibited, or if SMT is
+ * possible, as the capacity of SMT threads cannot be determined reliably.
+ */
+ if (no_cas || cpu_smt_possible())
return;
/*
@@ -1156,12 +1159,8 @@ static void hybrid_init_cpu_capacity_scaling(bool refresh)
return;
}
- /*
- * On hybrid systems, use asym capacity instead of ITMT, but because
- * the capacity of SMT threads is not deterministic even approximately,
- * do not do that when SMT is in use.
- */
- if (hwp_is_hybrid && !sched_smt_active() && arch_enable_hybrid_capacity_scale()) {
+ /* On hybrid systems, use asym capacity instead of ITMT */
+ if (hwp_is_hybrid && arch_enable_hybrid_capacity_scale()) {
hybrid_refresh_cpu_capacity_scaling();
/*
* Disabling ITMT causes sched domains to be rebuilt to disable asym
--
2.25.1
Powered by blists - more mailing lists