From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Paul E. McKenney" Subject: Re: [PATCH v7 6/6] MCS Lock: add Kconfig entries to allow arch-specific hooks Date: Sun, 19 Jan 2014 18:35:24 -0800 Message-ID: <20140120023524.GN10038@linux.vnet.ibm.com> References: <1389917316.3138.16.camel@schen9-DESK> Reply-To: paulmck@linux.vnet.ibm.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <1389917316.3138.16.camel@schen9-DESK> Sender: owner-linux-mm@kvack.org To: Tim Chen Cc: Ingo Molnar , Andrew Morton , Thomas Gleixner , Will Deacon , linux-kernel@vger.kernel.org, linux-mm , linux-arch@vger.kernel.org, Linus Torvalds , Waiman Long , Andrea Arcangeli , Alex Shi , Andi Kleen , Michel Lespinasse , Davidlohr Bueso , Matthew R Wilcox , Dave Hansen , Peter Zijlstra , Rik van Riel , Peter Hurley , Raghavendra K T , George List-Id: linux-arch.vger.kernel.org On Thu, Jan 16, 2014 at 04:08:36PM -0800, Tim Chen wrote: > This patch adds Kconfig entries to allow architectures to hook into the > MCS lock/unlock functions in the contended case. > > From: Will Deacon > Signed-off-by: Will Deacon Reviewed-by: Paul E. McKenney > --- > arch/Kconfig | 3 +++ > include/linux/mcs_spinlock.h | 8 ++++++++ > 2 files changed, 11 insertions(+) > > diff --git a/arch/Kconfig b/arch/Kconfig > index 80bbb8c..8a2a056 100644 > --- a/arch/Kconfig > +++ b/arch/Kconfig > @@ -303,6 +303,9 @@ config HAVE_CMPXCHG_LOCAL > config HAVE_CMPXCHG_DOUBLE > bool > > +config HAVE_ARCH_MCS_LOCK > + bool > + > config ARCH_WANT_IPC_PARSE_VERSION > bool > > diff --git a/include/linux/mcs_spinlock.h b/include/linux/mcs_spinlock.h > index d54bb23..d2c02ad 100644 > --- a/include/linux/mcs_spinlock.h > +++ b/include/linux/mcs_spinlock.h > @@ -12,6 +12,14 @@ > #ifndef __LINUX_MCS_SPINLOCK_H > #define __LINUX_MCS_SPINLOCK_H > > +/* > + * An architecture may provide its own lock/unlock functions for the > + * contended case. > + */ > +#ifdef CONFIG_HAVE_ARCH_MCS_LOCK > +#include > +#endif > + > struct mcs_spinlock { > struct mcs_spinlock *next; > int locked; /* 1 if lock acquired */ > -- > 1.7.11.7 > > -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from e39.co.us.ibm.com ([32.97.110.160]:48592 "EHLO e39.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752376AbaATCfb (ORCPT ); Sun, 19 Jan 2014 21:35:31 -0500 Received: from /spool/local by e39.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sun, 19 Jan 2014 19:35:31 -0700 Date: Sun, 19 Jan 2014 18:35:24 -0800 From: "Paul E. McKenney" Subject: Re: [PATCH v7 6/6] MCS Lock: add Kconfig entries to allow arch-specific hooks Message-ID: <20140120023524.GN10038@linux.vnet.ibm.com> Reply-To: paulmck@linux.vnet.ibm.com References: <1389917316.3138.16.camel@schen9-DESK> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1389917316.3138.16.camel@schen9-DESK> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Tim Chen Cc: Ingo Molnar , Andrew Morton , Thomas Gleixner , Will Deacon , linux-kernel@vger.kernel.org, linux-mm , linux-arch@vger.kernel.org, Linus Torvalds , Waiman Long , Andrea Arcangeli , Alex Shi , Andi Kleen , Michel Lespinasse , Davidlohr Bueso , Matthew R Wilcox , Dave Hansen , Peter Zijlstra , Rik van Riel , Peter Hurley , Raghavendra K T , George Spelvin , "H. Peter Anvin" , Arnd Bergmann , Aswin Chandramouleeswaran , Scott J Norton , "Figo.zhang" Message-ID: <20140120023524.sR7CTU7Oec8nzyJoPvLO0nr9_oLpMmnT9iwiseW3oD4@z> On Thu, Jan 16, 2014 at 04:08:36PM -0800, Tim Chen wrote: > This patch adds Kconfig entries to allow architectures to hook into the > MCS lock/unlock functions in the contended case. > > From: Will Deacon > Signed-off-by: Will Deacon Reviewed-by: Paul E. McKenney > --- > arch/Kconfig | 3 +++ > include/linux/mcs_spinlock.h | 8 ++++++++ > 2 files changed, 11 insertions(+) > > diff --git a/arch/Kconfig b/arch/Kconfig > index 80bbb8c..8a2a056 100644 > --- a/arch/Kconfig > +++ b/arch/Kconfig > @@ -303,6 +303,9 @@ config HAVE_CMPXCHG_LOCAL > config HAVE_CMPXCHG_DOUBLE > bool > > +config HAVE_ARCH_MCS_LOCK > + bool > + > config ARCH_WANT_IPC_PARSE_VERSION > bool > > diff --git a/include/linux/mcs_spinlock.h b/include/linux/mcs_spinlock.h > index d54bb23..d2c02ad 100644 > --- a/include/linux/mcs_spinlock.h > +++ b/include/linux/mcs_spinlock.h > @@ -12,6 +12,14 @@ > #ifndef __LINUX_MCS_SPINLOCK_H > #define __LINUX_MCS_SPINLOCK_H > > +/* > + * An architecture may provide its own lock/unlock functions for the > + * contended case. > + */ > +#ifdef CONFIG_HAVE_ARCH_MCS_LOCK > +#include > +#endif > + > struct mcs_spinlock { > struct mcs_spinlock *next; > int locked; /* 1 if lock acquired */ > -- > 1.7.11.7 > >