Re: [PATCH v3 2/3] x86/smp native_play_dead: Prefer cpuidle_play_dead() over mwait_play_dead()

From: Gautham R. Shenoy
Date: Thu Nov 14 2024 - 00:06:30 EST


Hello Dave,
On Wed, Nov 13, 2024 at 08:14:08AM -0800, Dave Hansen wrote:
> On 11/13/24 03:41, Gautham R. Shenoy wrote:
> > + /*
> > + * This is ugly. But AMD processors don't prefer MWAIT based
> > + * C-states when processors are offlined.
> > + */
> > + if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD ||
> > + boot_cpu_data.x86_vendor == X86_VENDOR_HYGON)
> > + return -ENODEV;
>
> Can we get an X86_FEATURE for this, please? Either a positive one:
>
> X86_FEATURE_MWAIT_OK_FOR_OFFLINE
>
> or a negative one:
>
> X86_FEATURE_MWAIT_BUSTED_FOR_OFFLINE
>

Sure. That makes sense.

> ... with better names.
>
> Or even a helper. Because if you add this AMD||HYGON check, it'll be at
> _least_ the second one of these for the same logical reason.

Fair enough. Will add that.

--
Thanks and Regards
gautham.