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

From: Gautham R. Shenoy
Date: Mon Nov 25 2024 - 00:46:17 EST


Hello Peter,

Apologies for the delay in response. I was away most of last week.

On Fri, Nov 15, 2024 at 11:11:00AM +0100, Peter Zijlstra wrote:

[..snip..]

> >
> > > But if it were to use MWAIT for regular idle, then surely it's OK for
> > > offline too, right?

Yes, this is not a problem.

> >
> > I tried this out today and there is no functional issue.
> >
> > However, I would like to run some experiments on whether HLT provides
> > better power savings than MWAIT C1 with CPUs offlined. I will get back
> > with this information tomorrow.
>
> Right, but in most cases you'll have C2/C3 with io ports specified and
> those will be picked for play_dead anyway. It's just the exceptionally
> weird BIOS case where you'll have C2/C3 as FFh -- because random BIOS
> person was on drugs that day or something like that.

It is unlikely to have a BIOSes on AMD platforms that allow users to
disable ACPI C2 state. That would be the only scenario when an
offlined CPU would enter FFH based C1.

>
> Anyway, what I'm trying to say is that you'll probably fine without
> adding a bunch of if (AMD|HYGON) logic -- the less of that we have, the
> better, etc..

I agree, I will resend the patch without this check.

--
Thanks and Regards
gautham.