Re: [PATCH 5/7] arm64: Select ARCH_HAS_CPU_RELAX

From: Russell King (Oracle)
Date: Tue Aug 29 2023 - 10:52:35 EST


On Wed, Aug 09, 2023 at 03:49:41PM +0200, Peter Zijlstra wrote:
> On Wed, Aug 09, 2023 at 02:39:39PM +0300, Mihai Carabas wrote:
> > From: Joao Martins <joao.m.martins@xxxxxxxxxx>
> >
> > cpu_relax() is necessary to allow cpuidle poll-state to be used,
> > so select it from ARM64 kconfig.
> >
> > Signed-off-by: Joao Martins <joao.m.martins@xxxxxxxxxx>
> > Signed-off-by: Mihai Carabas <mihai.carabas@xxxxxxxxxx>
> > ---
> > arch/arm64/Kconfig | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> > index 87ade6549790..7c47617b5722 100644
> > --- a/arch/arm64/Kconfig
> > +++ b/arch/arm64/Kconfig
> > @@ -105,6 +105,7 @@ config ARM64
> > select ARCH_WANT_LD_ORPHAN_WARN
> > select ARCH_WANTS_NO_INSTR
> > select ARCH_WANTS_THP_SWAP if ARM64_4K_PAGES
> > + select ARCH_HAS_CPU_RELAX
> > select ARCH_HAS_UBSAN_SANITIZE_ALL
> > select ARM_AMBA
> > select ARM_ARCH_TIMER
>
> Uh what ?! cpu_relax() is assumed present on all archs, no?

I think you have x86 to blame for that!

That symbol is used in drivers/acpi/processor_idle.c to setup stuff
for the cpuidle polling, and also by cpuidle's Makefile to build
poll_state.o

It isn't to do with the presence of cpu_relax() or not.

It probably ought to be renamed to CPUIDLE_CPU_RELAX which would
better describe its modern purpose.

--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!