From: Noam Camus Date: Sun, 28 May 2017 06:52:05 +0000 (+0300) Subject: ARC: [plat-eznps] spinlock aware for MTM X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1112c3b2ce5281a7118606648bb8cc010b2499ca;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git ARC: [plat-eznps] spinlock aware for MTM This way when we execute "ex" during trying to hold lock we can switch to other HW thread and utilize the core intead of just spinning on a lock. We noticed about 10% improvement of execution time with hackbench test. Signed-off-by: Noam Camus Signed-off-by: Vineet Gupta --- diff --git a/arch/arc/include/asm/spinlock.h b/arch/arc/include/asm/spinlock.h index 968c730ef114..193c9eb5a803 100644 --- a/arch/arc/include/asm/spinlock.h +++ b/arch/arc/include/asm/spinlock.h @@ -252,9 +252,15 @@ static inline void arch_spin_lock(arch_spinlock_t *lock) __asm__ __volatile__( "1: ex %0, [%1] \n" +#ifdef CONFIG_EZNPS_MTM_EXT + " .word %3 \n" +#endif " breq %0, %2, 1b \n" : "+&r" (val) : "r"(&(lock->slock)), "ir"(__ARCH_SPIN_LOCK_LOCKED__) +#ifdef CONFIG_EZNPS_MTM_EXT + , "i"(CTOP_INST_SCHD_RW) +#endif : "memory"); /*