[PATCH 8/8] kernel/cpu.c: Define bsp_hotpluggable variable

From: Fenghua Yu
Date: Wed Oct 05 2011 - 12:56:39 EST


From: Fenghua Yu <fenghua.yu@xxxxxxxxx>

This gloable variable controls BSP (aka CPU0) hotplug. If set, BSP is
hotpluggable. By default, it's 0. On X86, kernel option bsp_hotpluggable sets
the variable as 1.

Signed-off-by: Fenghua Yu <fenghua.yu@xxxxxxxxx>
---
include/linux/cpu.h | 2 ++
kernel/cpu.c | 5 +++++
2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index b1a635a..1b0b1ad 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -172,6 +172,8 @@ extern void put_online_cpus(void);
#define unregister_hotcpu_notifier(nb) unregister_cpu_notifier(nb)
int cpu_down(unsigned int cpu);

+extern int bsp_hotpluggable;
+
#ifdef CONFIG_ARCH_CPU_PROBE_RELEASE
extern void cpu_hotplug_driver_lock(void);
extern void cpu_hotplug_driver_unlock(void);
diff --git a/kernel/cpu.c b/kernel/cpu.c
index 12b7458..65d1a13 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -43,6 +43,11 @@ static int cpu_hotplug_disabled;

#ifdef CONFIG_HOTPLUG_CPU

+/*
+ * If set, BSP (aka CPU0) can be onlined/offlined. By default, it's not set.
+ */
+int bsp_hotpluggable;
+
static struct {
struct task_struct *active_writer;
struct mutex lock; /* Synchronizes accesses to refcount, */
--
1.6.0.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/