Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759551Ab2FAMNv (ORCPT ); Fri, 1 Jun 2012 08:13:51 -0400 Received: from e28smtp07.in.ibm.com ([122.248.162.7]:46992 "EHLO e28smtp07.in.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755437Ab2FAMNt (ORCPT ); Fri, 1 Jun 2012 08:13:49 -0400 Message-ID: <4FC8B1C6.4050503@linux.vnet.ibm.com> Date: Fri, 01 Jun 2012 17:42:54 +0530 From: "Srivatsa S. Bhat" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120424 Thunderbird/12.0 MIME-Version: 1.0 To: "linux-kernel@vger.kernel.org" CC: Tony Luck , Ralf Baechle , Benjamin Herrenschmidt , Paul Mundt , Chris Metcalf , Konrad Rzeszutek Wilk , Mike Frysinger , Hirokazu Takata , Richard Kuo , David Howells , Bob Liu , "David S. Miller" , Richard Weinberger , Jesper Nilsson , "James E.J. Bottomley" , Martin Schwidefsky , Russell King , Matt Turner , nikunj@linux.vnet.ibm.com Subject: Re: [PATCH 02/27] smpboot: Add provisions for arch-specific locking around cpu_online_mask References: <20120601090952.31979.24799.stgit@srivatsabhat.in.ibm.com> <20120601091024.31979.23253.stgit@srivatsabhat.in.ibm.com> In-Reply-To: <20120601091024.31979.23253.stgit@srivatsabhat.in.ibm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit x-cbid: 12060112-8878-0000-0000-000002BE5FE5 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2786 Lines: 81 Adding arch maintainers to Cc, which I had missed earlier. No changes to the patch. ====== From: Srivatsa S. Bhat Subject: [PATCH 02/27] smpboot: Add provisions for arch-specific locking around cpu_online_mask We want to make smp booting as generic as possible and remove code duplication in arch/ directories. While manipulating the cpu_online_mask, x86 uses an additional lock, i.e., 'vector_lock'. So provide a generic way to implement such arch-specific extra locking, by providing weakly defined functions arch_vector_lock() and arch_vector_unlock() which can be overriden by different architectures suitably. Cc: Thomas Gleixner Cc: Suresh Siddha Cc: Venkatesh Pallipadi Cc: Tony Luck Cc: Ralf Baechle Cc: Benjamin Herrenschmidt Cc: Paul Mundt Cc: Chris Metcalf Cc: Konrad Rzeszutek Wilk Cc: Mike Frysinger Cc: Hirokazu Takata Cc: Richard Kuo Cc: David Howells Cc: Bob Liu Cc: "David S. Miller" Cc: Richard Weinberger Cc: Jesper Nilsson Cc: "James E.J. Bottomley" Cc: Martin Schwidefsky Cc: Russell King Cc: Matt Turner Signed-off-by: Srivatsa S. Bhat --- kernel/smpboot.c | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-) diff --git a/kernel/smpboot.c b/kernel/smpboot.c index 6c26133..5ae1805 100644 --- a/kernel/smpboot.c +++ b/kernel/smpboot.c @@ -107,6 +107,13 @@ void __weak __cpu_pre_online(void *arg) {} void __weak __cpu_post_online(void *arg) {} #endif +/* + * Optional arch-specific locking for manipulating cpu_online_mask while + * bringing up secondary CPUs. + */ +void __weak arch_vector_lock(void) {} +void __weak arch_vector_unlock(void) {} + /** * smpboot_start_secondary - Generic way to boot secondary processors @@ -129,8 +136,10 @@ void __cpuinit smpboot_start_secondary(void *arg) __cpu_pre_online(arg); - /* Set the CPU in the cpu_online_mask */ + /* Set the CPU in the cpu_online_mask with required locks held */ + arch_vector_lock(); set_cpu_online(cpu, true); + arch_vector_unlock(); __cpu_post_online(arg); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/