Re: [PATCH 6/6] ARM: Inline locking functions for !PREEMPTION

Arnd Bergmann
2019-10-14T07:44:14Z

On Mon, Oct 14, 2019 at 12:14 AM Sebastian Andrzej Siewior
<sebastian@breakpoint.cc> wrote:
>
> On non-preemptive kernels, the locking instruction is less than 64 bytes
> and it makes sense to inline it. With PREEMPTION the kernel becomes very
> big if the locks are inlined.
>
> Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
> ---

At the moment, we have two architectures selecting all 28 symbols
and you are adding a third, all other architecture select none of them.

This tells me that the configurability has gone a little overboard. How about
adding a shortcut ARCH_INLINE_ALL_SPINLOCKS that selects the 28
symbols and using that for arm/arm64/s390?

Also, the output of 'size vmlinux' before and after the patch for
multi_v7_defconfig would be useful to have in the changelog, as there
are a couple of platforms that are particularly sensitive to object code
size changes.

Arnd

> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 4c780e7387208..21edc8e649261 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -26,6 +26,32 @@ config ARM
> select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
> select ARCH_HAVE_CUSTOM_GPIO_H
> select ARCH_HAS_GCOV_PROFILE_ALL
> + select ARCH_INLINE_READ_LOCK if !PREEMPTION
> + select ARCH_INLINE_READ_LOCK_BH if !PREEMPTION
> + select ARCH_INLINE_READ_LOCK_IRQ if !PREEMPTION
> + select ARCH_INLINE_READ_LOCK_IRQSAVE if !PREEMPTION
> + select ARCH_INLINE_READ_UNLOCK if !PREEMPTION
> + select ARCH_INLINE_READ_UNLOCK_BH if !PREEMPTION
> + select ARCH_INLINE_READ_UNLOCK_IRQ if !PREEMPTION
> + select ARCH_INLINE_READ_UNLOCK_IRQRESTORE if !PREEMPTION
> + select ARCH_INLINE_WRITE_LOCK if !PREEMPTION
> + select ARCH_INLINE_WRITE_LOCK_BH if !PREEMPTION
> + select ARCH_INLINE_WRITE_LOCK_IRQ if !PREEMPTION
> + select ARCH_INLINE_WRITE_LOCK_IRQSAVE if !PREEMPTION
> + select ARCH_INLINE_WRITE_UNLOCK if !PREEMPTION
> + select ARCH_INLINE_WRITE_UNLOCK_BH if !PREEMPTION
> + select ARCH_INLINE_WRITE_UNLOCK_IRQ if !PREEMPTION
> + select ARCH_INLINE_WRITE_UNLOCK_IRQRESTORE if !PREEMPTION
> + select ARCH_INLINE_SPIN_TRYLOCK if !PREEMPTION
> + select ARCH_INLINE_SPIN_TRYLOCK_BH if !PREEMPTION
> + select ARCH_INLINE_SPIN_LOCK if !PREEMPTION
> + select ARCH_INLINE_SPIN_LOCK_BH if !PREEMPTION
> + select ARCH_INLINE_SPIN_LOCK_IRQ if !PREEMPTION
> + select ARCH_INLINE_SPIN_LOCK_IRQSAVE if !PREEMPTION
> + select ARCH_INLINE_SPIN_UNLOCK if !PREEMPTION
> + select ARCH_INLINE_SPIN_UNLOCK_BH if !PREEMPTION
> + select ARCH_INLINE_SPIN_UNLOCK_IRQ if !PREEMPTION
> + select ARCH_INLINE_SPIN_UNLOCK_IRQRESTORE if !PREEMPTION
> select ARCH_KEEP_MEMBLOCK if HAVE_ARCH_PFN_VALID || KEXEC
> select ARCH_MIGHT_HAVE_PC_PARPORT
> select ARCH_NO_SG_CHAIN if !ARM_HAS_SG_CHAIN
> --
> 2.23.0