Re: [PATCH v8 01/11] cpuidle/poll_state: poll via smp_cond_load_relaxed()

From: Catalin Marinas
Date: Wed Oct 16 2024 - 06:08:34 EST


On Tue, Oct 15, 2024 at 02:32:00PM -0700, Ankur Arora wrote:
> Catalin Marinas <catalin.marinas@xxxxxxx> writes:
> > I'd say if you want
> > something like this, better introduce a new smp_cond_load_timeout()
> > API. The above looks like a hack that may only work on arm64 when the
> > event stream is enabled.
>
> I had a preliminary version of smp_cond_load_relaxed_timeout() here:
> https://lore.kernel.org/lkml/87edae3a1x.fsf@xxxxxxxxxx/
>
> Even with an smp_cond_load_timeout(), we would need to fallback to
> something like the above for uarchs without WFxT.

Yes, the default/generic implementation would use cpu_relax(). For the
arm64 one, some combination of __cmpwait() and __delay() with the
fallback to cpu_relax().

--
Catalin