ARC: [plat-eznps] spinlock aware for MTM
authorNoam Camus <noamca@mellanox.com>
Sun, 28 May 2017 06:52:05 +0000 (09:52 +0300)
committerVineet Gupta <vgupta@synopsys.com>
Mon, 28 Aug 2017 22:17:36 +0000 (15:17 -0700)
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 <noamca@mellanox.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
arch/arc/include/asm/spinlock.h

index 968c730ef114dec8f8f40ab4a13649b31374a443..193c9eb5a80354e9df201e960a27bb856dab78a0 100644 (file)
@@ -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");
 
        /*