lkml.org 
[lkml]   [2011]   [Nov]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v4 1/7] x86/topology.c: Support functions for BSP online/offline
Date
From: Fenghua Yu <fenghua.yu@intel.com>

By default, BSP can't be hotpluggable because bsp_hotpluggable is 0. Kernel
parameter bsp_hotplug can enable BSP hotplug feature.

Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
---
arch/x86/kernel/topology.c | 24 +++++++++++++++++-------
1 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/arch/x86/kernel/topology.c b/arch/x86/kernel/topology.c
index 76ee977..4493868 100644
--- a/arch/x86/kernel/topology.c
+++ b/arch/x86/kernel/topology.c
@@ -35,18 +35,28 @@
static DEFINE_PER_CPU(struct x86_cpu, cpu_devices);

#ifdef CONFIG_HOTPLUG_CPU
+
+static int __read_mostly bsp_hotpluggable;
+
+static int __init enable_bsp_hotplug(char *str)
+{
+ bsp_hotpluggable = 1;
+ return 1;
+}
+
+__setup("bsp_hotplug", enable_bsp_hotplug);
+
int __ref arch_register_cpu(int num)
{
/*
- * CPU0 cannot be offlined due to several
- * restrictions and assumptions in kernel. This basically
- * doesn't add a control file, one cannot attempt to offline
- * BSP.
+ * Resume from suspend/hibernate depends on BSP. PIC interrupts depend
+ * on BSP.
*
- * Also certain PCI quirks require not to enable hotplug control
- * for all CPU's.
+ * If the BSP depencies are under control, one can tell kernel to
+ * enable BSP hotplug. This basically adds a control file and
+ * one can attempt to offline BSP.
*/
- if (num)
+ if (num || bsp_hotpluggable)
per_cpu(cpu_devices, num).cpu.hotpluggable = 1;

return register_cpu(&per_cpu(cpu_devices, num).cpu, num);
--
1.6.0.3


\
 
 \ /
  Last update: 2011-11-12 06:47    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site