[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3633769.iIbC2pHGDl@rjwysocki.net>
Date: Wed, 28 May 2025 14:54:49 +0200
From: "Rafael J. Wysocki" <rjw@...ysocki.net>
To: x86 Maintainers <x86@...nel.org>
Cc: LKML <linux-kernel@...r.kernel.org>, Linux PM <linux-pm@...r.kernel.org>,
Len Brown <lenb@...nel.org>, Peter Zijlstra <peterz@...radead.org>,
Thomas Gleixner <tglx@...utronix.de>, Borislav Petkov <bp@...e.de>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Artem Bityutskiy <artem.bityutskiy@...ux.intel.com>,
"Gautham R. Shenoy" <gautham.shenoy@....com>, Ingo Molnar <mingo@...hat.com>,
Todd Brandt <todd.e.brandt@...ux.intel.com>
Subject:
[PATCH v1 2/2] x86/smp: Prefer cpuidle_play_dead() to
mwait_play_dead_cpuid_hint()
From: "Rafael J. Wysocki" <rafael.j.wysocki@...el.com>
Currently, mwait_play_dead_cpuid_hint() looks up the MWAIT hint of the
deepest idle state by inspecting CPUID leaf 0x05 with the assumption
that, if the number of sub-states for a given major C-state is nonzero,
those sub-states are always represented by consecutive numbers starting
from 0. This assumption is not based on the documented platform behavior
and in fact it is not met on recent Intel platforms (eg. Sierra Forest).
For this reason, it is better to let the cpuidle driver for the given
platform put CPUs going offline into appropriate idle state and only
if that fails, fall back to mwait_play_dead_cpuid_hint(), which may
still be the next best "play dead" variant if cpuidle is not available.
For example, when "nosmt" is passed to the kernel in the command line,
SMT siblings are disabled early, before cpuidle gets ready, but they
need to be put into sufficiently deep idle states to allow the whole
processor to reach deep package idle states, like PC10, later on.
Tested-by: Todd Brandt <todd.e.brandt@...ux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
---
arch/x86/kernel/smpboot.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -1377,9 +1377,10 @@
play_dead_common();
tboot_shutdown(TB_SHUTDOWN_WFS);
+ /* Each call in the following sequence returns only on errors. */
+ cpuidle_play_dead();
mwait_play_dead_cpuid_hint();
- if (cpuidle_play_dead())
- hlt_play_dead();
+ hlt_play_dead();
}
#else /* ... !CONFIG_HOTPLUG_CPU */
Powered by blists - more mailing lists