All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v8 0/12] x86: Arbitrary CPU hot(un)plug support
@ 2012-08-25 17:41 Fenghua Yu
  2012-08-25 17:41 ` [PATCH v8 01/12] doc: Add x86 CPU0 online/offline feature Fenghua Yu
                   ` (12 more replies)
  0 siblings, 13 replies; 27+ messages in thread
From: Fenghua Yu @ 2012-08-25 17:41 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner, H Peter Anvin, Linus Torvalds,
	Andrew Morton, Asit K Mallick, Tony Luck, Arjan Dan De Ven,
	Suresh B Siddha, Len Brown, Srivatssa S. Bhat, Randy Dunlap,
	Chen Gong, linux-kernel, linux-pm, x86
  Cc: Fenghua Yu

From: Fenghua Yu <fenghua.yu@intel.com>

CPU0 or BSP (Bootstrap Processor) has been the last processor that can not be
hot removed on x86. This patchset implements CPU0 or BSP online and offline
and removes this obstacle to CPU hotplug.

RAS needs the feature. If socket0 needs to be hotplugged for any reason (any
thread on socket0 is bad, shared cache issue, uncore issue, etc), CPU0 is
required to be offline or hot replaced to keep the system run. For example,
starting with Core Duo, if you have a system that is reporting cache problems
via the "yellow" status in the MCi_STATUS msr, then there is benefit in simply
soft off-lining the cores that share that cache - assuming that leaves you at
least one online core. A single socket system with L3 cache troubles is not
helped - but problems in L1/L2 cache, or on multi-socket systems can be avoided.
They are already being avoided for the cases where CPU0 is not involved.
This patchset can help L1/L2 cache problem in CPU0 or L3 cache problem on the
socket with CPU0 in a multi-socket system.

v8: Add smp_store_boot_cpu_info() and change smp_store_cpu_info() back to avoid
a compilation error. Fix a few messy subject issues.

v7: Change smp_store_cpu_info() to allow store cpuinfo for CPU0 when online.
Change PIC irq detection in native_cpu_disable().

v6: If CPU0 is offlined during boot time in CPU0 hotplug debug mode, put CPU0
online again before resuming from hibernation and disable x2apic and xapic.Don't
set __CPUINIT for start_cpu0() in head_32.S. Clean up CPU0 wake up nmi handler
after callin and callout sync. In a period (3 seconds), check if CPU0 wake up
NMI is handled after offlined CPU0 exits from mwait.

v5: Add CONFIG_BOOTPARAM_HOTPLUG_CPU0 and CONFIG_DEBUG_HOTPLUG_CPU0. Simplify
duplicate xstate_size init check. Wakeup CPU0 via nmi instead INITs. Add
mcheck_cpu_init when CPU0 online. Change variable bsp_hotpluggable to
cpu0_hotpluggable with __initdata qualifier.

v4: Add __read_mostly for internal bsp_hotpluggable variable. Add my email
address in cpu-hotplug.txt document. A wording change in comment.

v3: Register a pm notifier to check if CPU0 is online before hibernate/suspend.
Small wording changes in document and print info.

v2: Add locking changes between cpu hotplug and hibernate/suspend. Change PIC
irq bound to CPU0 detection.

Fenghua Yu (12):
  doc: Add x86 CPU0 online/offline feature
  x86, Kconfig: Add config switch for CPU0 hotplug
  x86, topology: Support functions for CPU0 online/offline
  x86, hotplug: Don't offline CPU0 if any PIC irq can not be migrated
    out of it
  x86, hotplug, suspend: Online CPU0 for suspend or hibernate
  x86-64, hotplug: Add start_cpu0() entry point to head_64.S
  x86-32, hotplug: Add start_cpu0() entry point to head_32.S
  x86, hotplug: Wake up CPU0 via NMI instead of INIT, SIPI, SIPI
  x86, hotplug: During CPU0 online, enable x2apic, set_numa_node.
  x86, hotplug: The first online processor saves the MTRR state
  x86/i387.c: Initialize thread xstate only on CPU0 only once
  x86, topology: Debug CPU00 hotplug

 Documentation/cpu-hotplug.txt       |   24 ++++++
 Documentation/kernel-parameters.txt |   14 +++
 arch/x86/Kconfig                    |   44 ++++++++++
 arch/x86/include/asm/cpu.h          |    4 +
 arch/x86/include/asm/smp.h          |    1 +
 arch/x86/kernel/cpu/common.c        |    5 +-
 arch/x86/kernel/cpu/mtrr/main.c     |    9 ++-
 arch/x86/kernel/head_32.S           |   12 +++
 arch/x86/kernel/head_64.S           |   15 ++++
 arch/x86/kernel/i387.c              |    6 +-
 arch/x86/kernel/smpboot.c           |  150 +++++++++++++++++++++++++++++------
 arch/x86/kernel/topology.c          |   92 ++++++++++++++++++++--
 arch/x86/power/cpu.c                |   82 +++++++++++++++++++
 13 files changed, 419 insertions(+), 39 deletions(-)

-- 
1.7.2


^ permalink raw reply	[flat|nested] 27+ messages in thread
* [PATCH v10 02/14] x86, Kconfig: Add config switch for CPU0 hotplug
@ 2012-11-13 19:32 Fenghua Yu
  2012-11-14 21:22 ` [tip:x86/bsp-hotplug] " tip-bot for Fenghua Yu
  0 siblings, 1 reply; 27+ messages in thread
From: Fenghua Yu @ 2012-11-13 19:32 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner, H Peter Anvin, Linus Torvalds,
	Andrew Morton, Asit K Mallick, Tony Luck, Arjan Dan De Ven,
	Suresh B Siddha, Len Brown, Srivatssa S. Bhat, Randy Dunlap,
	Rafael J. Wysocki, Chen Gong, linux-kernel, linux-pm, x86
  Cc: Fenghua Yu

From: Fenghua Yu <fenghua.yu@intel.com>

New config switch CONFIG_BOOTPARAM_HOTPLUG_CPU0 sets default state of whether
the CPU0 hotplug is on or off.

If the switch is off, CPU0 is not hotpluggable by default. But the CPU0 hotplug
feature can still be turned on by kernel parameter cpu0_hotplug at boot.

If the switch is on, CPU0 is always hotpluggable.

The default value of the switch is off.

Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
---
 arch/x86/Kconfig |   29 +++++++++++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 650e6a4..933ff87 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -1730,6 +1730,35 @@ config HOTPLUG_CPU
 	    automatically on SMP systems. )
 	  Say N if you want to disable CPU hotplug.
 
+config BOOTPARAM_HOTPLUG_CPU0
+	bool "Set default setting of cpu0_hotpluggable"
+	default n
+	depends on HOTPLUG_CPU && EXPERIMENTAL
+	---help---
+	  Set whether default state of cpu0_hotpluggable is on or off.
+
+	  Say Y here to enable CPU0 hotplug by default. If this switch
+	  is turned on, there is no need to give cpu0_hotplug kernel
+	  parameter and the CPU0 hotplug feature is enabled by default.
+
+	  Please note: there are two known CPU0 dependencies if you want
+	  to enable the CPU0 hotplug feature either by this switch or by
+	  cpu0_hotplug kernel parameter.
+
+	  First, resume from hibernate or suspend always starts from CPU0.
+	  So hibernate and suspend are prevented if CPU0 is offline.
+
+	  Second dependency is PIC interrupts always go to CPU0. CPU0 can not
+	  offline if any interrupt can not migrate out of CPU0. There may
+	  be other CPU0 dependencies.
+
+	  Please make sure the dependencies are under your control before
+	  you enable this feature.
+
+	  Say N if you don't want to enable CPU0 hotplug feature by default.
+	  You still can enable the CPU0 hotplug feature at boot by kernel
+	  parameter cpu0_hotplug.
+
 config COMPAT_VDSO
 	def_bool y
 	prompt "Compat VDSO support"
-- 
1.7.2

^ permalink raw reply related	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2012-11-14 22:43 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-25 17:41 [PATCH v8 0/12] x86: Arbitrary CPU hot(un)plug support Fenghua Yu
2012-08-25 17:41 ` [PATCH v8 01/12] doc: Add x86 CPU0 online/offline feature Fenghua Yu
2012-08-27 17:07   ` [tip:x86/bsp-hotplug] " tip-bot for Fenghua Yu
2012-08-25 17:41 ` [PATCH v8 02/12] x86, Kconfig: Add config switch for CPU0 hotplug Fenghua Yu
2012-08-27 17:08   ` [tip:x86/bsp-hotplug] " tip-bot for Fenghua Yu
2012-08-25 17:41 ` [PATCH v8 03/12] x86, topology: Don't offline CPU0 if any PIC irq can not be migrated out of it Fenghua Yu
2012-08-27 17:09   ` [tip:x86/bsp-hotplug] x86, topology: Don' t " tip-bot for Fenghua Yu
2012-08-25 17:41 ` [PATCH v8 04/12] x86, hotplug: Support functions for CPU0 online/offline Fenghua Yu
2012-08-27 17:10   ` [tip:x86/bsp-hotplug] " tip-bot for Fenghua Yu
2012-08-25 17:41 ` [PATCH v8 05/12] x86, hotplug, suspend: Online CPU0 for suspend or hibernate Fenghua Yu
2012-08-27 17:10   ` [tip:x86/bsp-hotplug] " tip-bot for Fenghua Yu
2012-08-25 17:41 ` [PATCH v8 06/12] x86-64, hotplug: Add start_cpu0() entry point to head_64.S Fenghua Yu
2012-08-27 17:11   ` [tip:x86/bsp-hotplug] " tip-bot for Fenghua Yu
2012-08-25 17:41 ` [PATCH v8 07/12] x86-32, hotplug: Add start_cpu0() entry point to head_32.S Fenghua Yu
2012-08-27 17:12   ` [tip:x86/bsp-hotplug] " tip-bot for Fenghua Yu
2012-08-25 17:41 ` [PATCH v8 08/12] x86, hotplug: Wake up CPU0 via NMI instead of INIT, SIPI, SIPI Fenghua Yu
2012-08-27 17:13   ` [tip:x86/bsp-hotplug] " tip-bot for Fenghua Yu
2012-08-25 17:41 ` [PATCH v8 09/12] x86, hotplug: During CPU0 online, enable x2apic, set_numa_node Fenghua Yu
2012-08-27 17:14   ` [tip:x86/bsp-hotplug] " tip-bot for Fenghua Yu
2012-08-25 17:41 ` [PATCH v8 10/12] x86, hotplug: The first online processor saves the MTRR state Fenghua Yu
2012-08-27 17:15   ` [tip:x86/bsp-hotplug] " tip-bot for Fenghua Yu
2012-08-25 17:41 ` [PATCH v8 11/12] x86/i387.c: Initialize thread xstate only on CPU0 only once Fenghua Yu
2012-08-27 17:16   ` [tip:x86/bsp-hotplug] " tip-bot for Fenghua Yu
2012-08-25 17:41 ` [PATCH v8 12/12] x86, topology: Debug CPU00 hotplug Fenghua Yu
2012-08-27 17:17   ` [tip:x86/bsp-hotplug] x86, topology: Debug CPU0 hotplug tip-bot for Fenghua Yu
2012-09-10  5:50 ` [PATCH v8 0/12] x86: Arbitrary CPU hot(un)plug support Ingo Molnar
  -- strict thread matches above, loose matches on Subject: below --
2012-11-13 19:32 [PATCH v10 02/14] x86, Kconfig: Add config switch for CPU0 hotplug Fenghua Yu
2012-11-14 21:22 ` [tip:x86/bsp-hotplug] " tip-bot for Fenghua Yu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.