From patchwork Fri Jan 25 07:51:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [v2, powerpc] Avoid debug_smp_processor_id() check in SHARED_PROCESSOR From: Li Zhong X-Patchwork-Id: 215569 Message-Id: <1359100273.2666.51.camel@ThinkPad-T5421.cn.ibm.com> To: Benjamin Herrenschmidt Cc: Paul Mackerras , "Paul E. McKenney" , PowerPC email list Date: Fri, 25 Jan 2013 15:51:13 +0800 Use local_paca directly in macro SHARED_PROCESSOR, as all processors have the same value for the field shared_proc, so we don't need care racy here. Reported-by: Paul E. McKenney Signed-off-by: Li Zhong --- arch/powerpc/include/asm/spinlock.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/include/asm/spinlock.h b/arch/powerpc/include/asm/spinlock.h index 7124fc0..5b23f91 100644 --- a/arch/powerpc/include/asm/spinlock.h +++ b/arch/powerpc/include/asm/spinlock.h @@ -96,7 +96,7 @@ static inline int arch_spin_trylock(arch_spinlock_t *lock) #if defined(CONFIG_PPC_SPLPAR) /* We only yield to the hypervisor if we are in shared processor mode */ -#define SHARED_PROCESSOR (get_lppaca()->shared_proc) +#define SHARED_PROCESSOR (local_paca->lppaca_ptr->shared_proc) extern void __spin_yield(arch_spinlock_t *lock); extern void __rw_yield(arch_rwlock_t *lock); #else /* SPLPAR */