locking/Kconfig: Add INLINE_SPINLOCKS & INLINE_RWLOCKS
Will Deacon
Acked-by[I thought I replied to this already but I can't find any evidence of that.
Apologies if you receive this twice!]
Quoted 46 lines · Waiman Long
Both the arm64 and s390 architectures decide to inline all the spinlock and rwlock functions except the
read_trylock()andwrite_trylock()functions for arm64. As other architectures are contemplating about inlining those locking functions as well, it makes sense to make it easier and less error-prone to do this.Two new
KconfigoptionsINLINE_SPINLOCKSandINLINE_RWLOCKSand their ARCH_* counterparts are now added to streamline this process. The s390 and arm64'sKconfigfiles are modified to use the newKconfigoptions.There is no functional change for s390. For arm64, both
read_trylock()andwrite_trylock()are now inlined as well.Suggested-by Arnd Bergmann <[email protected]>Signed-off-by Waiman Long <[email protected]>--- arch/arm64/Kconfig | 28 ++------------------------- arch/s390/Kconfig | 30 ++--------------------------- kernel/Kconfig.locks | 45 +++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 48 insertions(+), 55 deletions(-)arch/arm64/Kconfig +0
-17@@ -35,32 +35,8 @@ config ARM64 select ARCH_HAS_TEARDOWN_DMA_OPS if IOMMU_SUPPORT select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST select ARCH_HAVE_NMI_SAFE_CMPXCHG - select ARCH_INLINE_READ_LOCK if !PREEMPT - select ARCH_INLINE_READ_LOCK_BH if !PREEMPT - select ARCH_INLINE_READ_LOCK_IRQ if !PREEMPT - select ARCH_INLINE_READ_LOCK_IRQSAVE if !PREEMPT - select ARCH_INLINE_READ_UNLOCK if !PREEMPT - select ARCH_INLINE_READ_UNLOCK_BH if !PREEMPT - select ARCH_INLINE_READ_UNLOCK_IRQ if !PREEMPT - select ARCH_INLINE_READ_UNLOCK_IRQRESTORE if !PREEMPT - select ARCH_INLINE_WRITE_LOCK if !PREEMPT - select ARCH_INLINE_WRITE_LOCK_BH if !PREEMPT - select ARCH_INLINE_WRITE_LOCK_IRQ if !PREEMPT - select ARCH_INLINE_WRITE_LOCK_IRQSAVE if !PREEMPT - select ARCH_INLINE_WRITE_UNLOCK if !PREEMPT - select ARCH_INLINE_WRITE_UNLOCK_BH if !PREEMPT - select ARCH_INLINE_WRITE_UNLOCK_IRQ if !PREEMPT - select ARCH_INLINE_WRITE_UNLOCK_IRQRESTORE if !PREEMPT - select ARCH_INLINE_SPIN_TRYLOCK if !PREEMPT
arch/arm64/Kconfig config ARM64 · line 38
Quoted 10 lines
arch/arm64/Kconfig +1
-9- select ARCH_INLINE_SPIN_TRYLOCK_BH if !PREEMPT - select ARCH_INLINE_SPIN_LOCK if !PREEMPT - select ARCH_INLINE_SPIN_LOCK_BH if !PREEMPT - select ARCH_INLINE_SPIN_LOCK_IRQ if !PREEMPT - select ARCH_INLINE_SPIN_LOCK_IRQSAVE if !PREEMPT - select ARCH_INLINE_SPIN_UNLOCK if !PREEMPT - select ARCH_INLINE_SPIN_UNLOCK_BH if !PREEMPT - select ARCH_INLINE_SPIN_UNLOCK_IRQ if !PREEMPT - select ARCH_INLINE_SPIN_UNLOCK_IRQRESTORE if !PREEMPT + select ARCH_INLINE_RWLOCKS if !PREEMPT
This is a change in behaviour, since you're now selecting both ARCH_INLINE_READ_TRYLOCK and ARCH_INLINE_WRITE_TRYLOCK for arm64.
However, I /think/ that's probably just because I missed that when enabling the others, so cautiously:
Will