Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751216AbdFBSg3 (ORCPT ); Fri, 2 Jun 2017 14:36:29 -0400 Received: from smtprelay.synopsys.com ([198.182.47.9]:54806 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750918AbdFBSg2 (ORCPT ); Fri, 2 Jun 2017 14:36:28 -0400 Subject: Re: [PATCH v2 08/11] ARC: [plat-eznps] spinlock aware for MTM To: Noam Camus , CC: Newsgroups: gmane.linux.kernel.arc,gmane.linux.kernel References: <1495954328-28736-1-git-send-email-noamca@mellanox.com> <1495954328-28736-9-git-send-email-noamca@mellanox.com> From: Vineet Gupta Message-ID: <180d8e76-fa00-b138-0d5f-720b116228b8@synopsys.com> Date: Fri, 2 Jun 2017 11:36:17 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <1495954328-28736-9-git-send-email-noamca@mellanox.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.10.161.108] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1174 Lines: 38 On 05/27/2017 11:52 PM, Noam Camus wrote: > From: Noam Camus > > 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 > --- > 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