[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241112140127.GH6497@noisy.programming.kicks-ass.net>
Date: Tue, 12 Nov 2024 15:01:27 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Artem Bityutskiy <artem.bityutskiy@...ux.intel.com>
Cc: "Rafael J. Wysocki" <rafael@...nel.org>,
Patryk Wlazlyn <patryk.wlazlyn@...ux.intel.com>, x86@...nel.org,
linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org,
rafael.j.wysocki@...el.com, len.brown@...el.com,
dave.hansen@...ux.intel.com
Subject: Re: [PATCH v3 2/3] x86/smp native_play_dead: Prefer
cpuidle_play_dead() over mwait_play_dead()
On Tue, Nov 12, 2024 at 02:44:49PM +0200, Artem Bityutskiy wrote:
> On Tue, 2024-11-12 at 13:18 +0100, Peter Zijlstra wrote:
> > But on Intel we really don't want HLT, and had that MWAIT, but that has
> > real problems with KEXEC. And I don't think we can rely on INTEL_IDLE=y.
>
> If INTEL_IDLE is not set, then we'll just use existing mwait creation algorithm
> in 'mwait_play_dead()', which works too, just not ideal.
So why not fix the substate detectoring function and ignore everything?
> > Anyway, ideally x86 would grow a new instruction to offline a CPU, both
> > MWAIT and HLT have problems vs non-maskable interrupts.
> ... snip ...
> > But as said, we need a new instruction.
>
> FYI, I already started discussing a special "gimme the deepest C-state" mwait
> hint - just a constant like 0xFF. CPUID leaf 5 has many reserved bits, one could
> be used for enumeration of this feature.
>
> But this is just a quick idea so far, and informal discussions so far.
No, not mwait hint. We need an instruction that:
- goes to deepest C state
- drops into WAIT-for-Start-IPI (SIPI)
Notably, it should not wake from:
- random memory writes
- NMI, MCE, SMI and other such non-maskable thingies
- anything else -- the memory pointed to by RIP might no longer exist
Lets call the instruction: DEAD.
With the mwait 'hack', kexec still goes belly up if it gets a spurious
NMI (and them others) at an inopportune time, and this does happen
afaik. Just not enough to worry the data center guys like the mwait
thing.
Powered by blists - more mailing lists