From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752105AbaAQAIu (ORCPT ); Thu, 16 Jan 2014 19:08:50 -0500 Received: from mga09.intel.com ([134.134.136.24]:17383 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752070AbaAQAIk (ORCPT ); Thu, 16 Jan 2014 19:08:40 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.95,670,1384329600"; d="scan'208";a="467970007" Subject: [PATCH v7 6/6] MCS Lock: add Kconfig entries to allow arch-specific hooks From: Tim Chen To: Ingo Molnar , Andrew Morton , Thomas Gleixner , "Paul E.McKenney" , Will Deacon Cc: 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 , Tim Chen , Raghavendra K T , George Spelvin , "H. Peter Anvin" , Arnd Bergmann , Aswin Chandramouleeswaran , Scott J Norton , "Figo.zhang" In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Date: Thu, 16 Jan 2014 16:08:36 -0800 Message-ID: <1389917316.3138.16.camel@schen9-DESK> Mime-Version: 1.0 X-Mailer: Evolution 2.32.3 (2.32.3-1.fc14) Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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