From patchwork Thu May 9 22:01:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 2545961 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork1.kernel.org (Postfix) with ESMTP id 952BB3FC5A for ; Thu, 9 May 2013 22:01:58 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UaYuM-0000KT-Fi; Thu, 09 May 2013 22:01:50 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UaYuK-0004YP-4D; Thu, 09 May 2013 22:01:48 +0000 Received: from mail.linuxfoundation.org ([140.211.169.12]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UaYuI-0004Xs-8D for linux-arm-kernel@lists.infradead.org; Thu, 09 May 2013 22:01:46 +0000 Received: from akpm3.mtv.corp.google.com (unknown [216.239.45.95]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 428E5271; Thu, 9 May 2013 22:01:22 +0000 (UTC) Date: Thu, 9 May 2013 15:01:21 -0700 From: Andrew Morton To: Robin Holt Subject: Re: [PATCH -v8 01/11] CPU hotplug: Provide a generic helper to disable/enable CPU hotplug Message-Id: <20130509150121.8c3ef60b2fc748ce542a1a52@linux-foundation.org> In-Reply-To: <1367937595-32241-2-git-send-email-holt@sgi.com> References: <1367937595-32241-1-git-send-email-holt@sgi.com> <1367937595-32241-2-git-send-email-holt@sgi.com> X-Mailer: Sylpheed 3.2.0beta5 (GTK+ 2.24.10; x86_64-pc-linux-gnu) Mime-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130509_180146_349590_E110DD1C X-CRM114-Status: GOOD ( 17.68 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Russ Anderson , Russell King , the arch/x86 maintainers , Linux Kernel Mailing List , stable@vger.kernel.org, "Rafael J. Wysocki" , "Srivatsa S. Bhat" , "H. Peter Anvin" , Guan Xuetao , Arm Mailing List X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org On Tue, 7 May 2013 09:39:45 -0500 Robin Holt wrote: > From: "Srivatsa S. Bhat" > > There are instances in the kernel where we would like to disable > CPU hotplug (from sysfs) during some important operation. Today > the freezer code depends on this and the code to do it was kinda > tailor-made for that. > > Restructure the code and make it generic enough to be useful for > other usecases too. > > ... > > --- a/include/linux/cpu.h > +++ b/include/linux/cpu.h > @@ -141,6 +141,8 @@ static inline void unregister_cpu_notifier(struct notifier_block *nb) > } > #endif > > +extern void cpu_hotplug_disable(void); > +extern void cpu_hotplug_enable(void); > int cpu_up(unsigned int cpu); > void notify_cpu_starting(unsigned int cpu); > extern void cpu_maps_update_begin(void); > @@ -148,6 +150,7 @@ extern void cpu_maps_update_done(void); > > #else /* CONFIG_SMP */ > > +#define cpu_hotplug_disable() do { } while (0) > #define cpu_notifier(fn, pri) do { (void)(fn); } while (0) > Breaks alpha allmodconfig because cpu_hotplug_disable() is absent from vmlinux. cpu_hotplug_disable() doesn't get compiled unless we've defined CONFIG_PM_SLEEP_SMP. I cannot begin to imagine what the logic is behind that! I'll stick this in there and see what happens. --- a/include/linux/cpu.h~cpu-hotplug-provide-a-generic-helper-to-disable-enable-cpu-hotplug-fix +++ a/include/linux/cpu.h @@ -141,8 +141,6 @@ static inline void unregister_cpu_notifi } #endif -extern void cpu_hotplug_disable(void); -extern void cpu_hotplug_enable(void); int cpu_up(unsigned int cpu); void notify_cpu_starting(unsigned int cpu); extern void cpu_maps_update_begin(void); @@ -150,7 +148,6 @@ extern void cpu_maps_update_done(void); #else /* CONFIG_SMP */ -#define cpu_hotplug_disable() do { } while (0) #define cpu_notifier(fn, pri) do { (void)(fn); } while (0) static inline int register_cpu_notifier(struct notifier_block *nb) @@ -171,6 +168,15 @@ static inline void cpu_maps_update_done( } #endif /* CONFIG_SMP */ + +#ifdef CONFIG_PM_SLEEP_SMP +extern void cpu_hotplug_enable(void); +extern void cpu_hotplug_disable(void); +#else +#define cpu_hotplug_enable() do { } while (0) +#define cpu_hotplug_disable() do { } while (0) +#endif + extern struct bus_type cpu_subsys; #ifdef CONFIG_HOTPLUG_CPU