lkml.org 
[lkml]   [2017]   [Jun]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2 08/11] ARC: [plat-eznps] spinlock aware for MTM
From
Date
On 05/27/2017 11:52 PM, Noam Camus wrote:
> From: Noam Camus <noamca@mellanox.com>
>
> 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>
> ---
> arch/arc/include/asm/spinlock.h | 6 ++++++
> 1 files changed, 6 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arc/include/asm/spinlock.h b/arch/arc/include/asm/spinlock.h
> index 233d5ff..0a54ce7 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");
>
> /*
>

This is ugly - I will fix it up here to create an NPS version of arch_spin_lock !

-Vineet

\
 
 \ /
  Last update: 2017-06-05 00:14    [W:0.154 / U:0.848 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site