[SRU][Jammy][PATCH 3/7] intel_idle: add core C6 optimization for SPR
Joseph Salisbury
joseph.salisbury at canonical.com
Tue Feb 7 17:58:53 UTC 2023
From: Artem Bityutskiy <artem.bityutskiy at linux.intel.com>
BugLink: https://bugs.launchpad.net/bugs/2003267
Add a Sapphire Rapids Xeon C6 optimization, similar to what we have for Sky Lake
Xeon: if package C6 is disabled, adjust C6 exit latency and target residency to
match core C6 values, instead of using the default package C6 values.
Signed-off-by: Artem Bityutskiy <artem.bityutskiy at linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki at intel.com>
(cherry picked from commit 3a9cf77b60dc9839b6674943bb7c9dcd524b6294)
Signed-off-by: Joseph Salisbury <joseph.salisbury at canonical.com>
---
drivers/idle/intel_idle.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
index 1381610a50d2..1545b7064820 100644
--- a/drivers/idle/intel_idle.c
+++ b/drivers/idle/intel_idle.c
@@ -1595,6 +1595,8 @@ static void __init skx_idle_state_table_update(void)
*/
static void __init spr_idle_state_table_update(void)
{
+ unsigned long long msr;
+
/* Check if user prefers C1E over C1. */
if (preferred_states_mask & BIT(2)) {
if (preferred_states_mask & BIT(1))
@@ -1608,6 +1610,19 @@ static void __init spr_idle_state_table_update(void)
c1e_promotion_enable();
disable_promotion_to_c1e = false;
}
+
+ /*
+ * By default, the C6 state assumes the worst-case scenario of package
+ * C6. However, if PC6 is disabled, we update the numbers to match
+ * core C6.
+ */
+ rdmsrl(MSR_PKG_CST_CONFIG_CONTROL, msr);
+
+ /* Limit value 2 and above allow for PC6. */
+ if ((msr & 0x7) < 2) {
+ spr_cstates[2].exit_latency = 190;
+ spr_cstates[2].target_residency = 600;
+ }
}
static bool __init intel_idle_verify_cstate(unsigned int mwait_hint)
--
2.34.1
More information about the kernel-team
mailing list