From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Srivatsa S. Bhat" Subject: [PATCH 3/3] CPU hotplug, arch/sparc: Fix CPU hotplug callback registration Date: Thu, 01 Mar 2012 13:48:30 +0530 Message-ID: <4F4F30D6.3000707@linux.vnet.ibm.com> References: <87ehtf3lqh.fsf@rustcorp.com.au> <20120227155338.7b5110cd.akpm@linux-foundation.org> <20120228084359.GJ21106@elte.hu> <20120228132719.f375071a.akpm@linux-foundation.org> <4F4DBB26.2060907@linux.vnet.ibm.com> <20120229091732.GA11505@elte.hu> <4F4E083A.2080304@linux.vnet.ibm.com> <4F4F2F7F.5040207@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: sparclinux@vger.kernel.org, Andi Kleen , Nick Piggin , KOSAKI Motohiro , Rusty Russell , linux-kernel , "Rafael J. Wysocki" , Paul Gortmaker , Alexander Viro , Arjan van de Ven , linux-fsdevel@vger.kernel.org, Andrew Morton , "Paul E. McKenney" , ppc-dev , "David S. Miller" , Peter Zijlstra To: Ingo Molnar Return-path: Received: from e28smtp03.in.ibm.com ([122.248.162.3]:59300 "EHLO e28smtp03.in.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756051Ab2CAIS4 (ORCPT ); Thu, 1 Mar 2012 03:18:56 -0500 Received: from /spool/local by e28smtp03.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 1 Mar 2012 13:48:53 +0530 In-Reply-To: <4F4F2F7F.5040207@linux.vnet.ibm.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Restructure CPU hotplug setup and callback registration in topology_init so as to be race-free. --- arch/sparc/kernel/sysfs.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/sparc/kernel/sysfs.c b/arch/sparc/kernel/sysfs.c index 654e8aa..22cb881 100644 --- a/arch/sparc/kernel/sysfs.c +++ b/arch/sparc/kernel/sysfs.c @@ -300,16 +300,14 @@ static int __init topology_init(void) check_mmu_stats(); - register_cpu_notifier(&sysfs_cpu_nb); - for_each_possible_cpu(cpu) { struct cpu *c = &per_cpu(cpu_devices, cpu); register_cpu(c, cpu); - if (cpu_online(cpu)) - register_cpu_online(cpu); } + register_allcpu_notifier(&sysfs_cpu_nb, true, NULL); + return 0; }