aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/cpu.h
diff options
context:
space:
mode:
authorSrivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>2013-06-12 17:04:36 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-06-12 19:29:44 -0400
commit16e53dbf10a2d7e228709a7286310e629ede5e45 (patch)
tree4b606e077ba322764c584493243bbede219f737f /include/linux/cpu.h
parent77293e215edef7871a39de4b326f777bc39278ca (diff)
CPU hotplug: provide a generic helper to disable/enable CPU hotplug
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. Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com> Signed-off-by: Robin Holt <holt@sgi.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@elte.hu> Cc: Russ Anderson <rja@sgi.com> Cc: Robin Holt <holt@sgi.com> Cc: Russell King <linux@arm.linux.org.uk> Cc: Guan Xuetao <gxt@mprc.pku.edu.cn> Cc: Shawn Guo <shawn.guo@linaro.org> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/cpu.h')
-rw-r--r--include/linux/cpu.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index c6f6e0839b61..9f3c7e81270a 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -175,6 +175,8 @@ extern struct bus_type cpu_subsys;
175 175
176extern void get_online_cpus(void); 176extern void get_online_cpus(void);
177extern void put_online_cpus(void); 177extern void put_online_cpus(void);
178extern void cpu_hotplug_disable(void);
179extern void cpu_hotplug_enable(void);
178#define hotcpu_notifier(fn, pri) cpu_notifier(fn, pri) 180#define hotcpu_notifier(fn, pri) cpu_notifier(fn, pri)
179#define register_hotcpu_notifier(nb) register_cpu_notifier(nb) 181#define register_hotcpu_notifier(nb) register_cpu_notifier(nb)
180#define unregister_hotcpu_notifier(nb) unregister_cpu_notifier(nb) 182#define unregister_hotcpu_notifier(nb) unregister_cpu_notifier(nb)
@@ -198,6 +200,8 @@ static inline void cpu_hotplug_driver_unlock(void)
198 200
199#define get_online_cpus() do { } while (0) 201#define get_online_cpus() do { } while (0)
200#define put_online_cpus() do { } while (0) 202#define put_online_cpus() do { } while (0)
203#define cpu_hotplug_disable() do { } while (0)
204#define cpu_hotplug_enable() do { } while (0)
201#define hotcpu_notifier(fn, pri) do { (void)(fn); } while (0) 205#define hotcpu_notifier(fn, pri) do { (void)(fn); } while (0)
202/* These aren't inline functions due to a GCC bug. */ 206/* These aren't inline functions due to a GCC bug. */
203#define register_hotcpu_notifier(nb) ({ (void)(nb); 0; }) 207#define register_hotcpu_notifier(nb) ({ (void)(nb); 0; })