All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v10 0/14] x86: Arbitrary CPU hot(un)plug support
@ 2012-11-13 19:32 Fenghua Yu
  2012-11-13 19:32 ` [PATCH v10 01/14] doc: Add x86 CPU0 online/offline feature Fenghua Yu
                   ` (13 more replies)
  0 siblings, 14 replies; 35+ 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>

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.

v10: Use first online CPU to handle retriggered irq in ioapic. Correct
cpu0_logical_apicid for x2apic. Add wakeup_cpu_via_init_nmi() to make code more
readable. Add ENDPROC(start_cpu0). Add comment for pm_notifier priority in
cpu_hotplug_pm_callback.

v9: Add Intel vendor check to support the feature on Intel platforms only.

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 (14):
  doc: Add x86 CPU0 online/offline feature
  x86, Kconfig: Add config switch for CPU0 hotplug
  x86, topology: Don't offline CPU0 if any PIC irq can not be migrated
    out of it
  x86, hotplug: Support functions for CPU0 online/offline
  x86, hotplug, suspend: Online CPU0 for suspend or hibernate
  kernel/cpu.c: Add comment for priority in cpu_hotplug_pm_callback
  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, hotplug: Handle retrigger irq by the first available CPU
  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/apic/io_apic.c      |    4 +-
 arch/x86/kernel/cpu/common.c        |    5 +-
 arch/x86/kernel/cpu/mtrr/main.c     |    9 ++-
 arch/x86/kernel/head_32.S           |   13 +++
 arch/x86/kernel/head_64.S           |   16 ++++
 arch/x86/kernel/i387.c              |    6 +-
 arch/x86/kernel/smpboot.c           |  151 ++++++++++++++++++++++++++++------
 arch/x86/kernel/topology.c          |  101 ++++++++++++++++++++++--
 arch/x86/power/cpu.c                |   82 +++++++++++++++++++
 kernel/cpu.c                        |    5 +
 15 files changed, 438 insertions(+), 41 deletions(-)

-- 
1.7.2


^ permalink raw reply	[flat|nested] 35+ messages in thread
* [PATCH v8 09/12] x86, hotplug: During CPU0 online, enable x2apic, set_numa_node.
@ 2012-08-25 17:41 Fenghua Yu
  2012-08-27 17:14 ` [tip:x86/bsp-hotplug] " tip-bot for Fenghua Yu
  0 siblings, 1 reply; 35+ 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>

Previously these functions were not run on the BSP (CPU 0, the boot processor)
since the boot processor init would only be executed before this functionality
was initialized.

Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
---
 arch/x86/kernel/cpu/common.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 2ea24da..ce8b772 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -1223,7 +1223,7 @@ void __cpuinit cpu_init(void)
 	oist = &per_cpu(orig_ist, cpu);
 
 #ifdef CONFIG_NUMA
-	if (cpu != 0 && this_cpu_read(numa_node) == 0 &&
+	if (this_cpu_read(numa_node) == 0 &&
 	    early_cpu_to_node(cpu) != NUMA_NO_NODE)
 		set_numa_node(early_cpu_to_node(cpu));
 #endif
@@ -1255,8 +1255,7 @@ void __cpuinit cpu_init(void)
 	barrier();
 
 	x86_configure_nx();
-	if (cpu != 0)
-		enable_x2apic();
+	enable_x2apic();
 
 	/*
 	 * set up and load the per-CPU TSS
-- 
1.7.2


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

end of thread, other threads:[~2012-11-15  0:29 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-13 19:32 [PATCH v10 0/14] x86: Arbitrary CPU hot(un)plug support Fenghua Yu
2012-11-13 19:32 ` [PATCH v10 01/14] doc: Add x86 CPU0 online/offline feature Fenghua Yu
2012-11-14 21:21   ` [tip:x86/bsp-hotplug] " tip-bot for Fenghua Yu
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
2012-11-13 19:32 ` [PATCH v10 03/14] x86, topology: Don't offline CPU0 if any PIC irq can not be migrated out of it Fenghua Yu
2012-11-14 21:23   ` [tip:x86/bsp-hotplug] x86, topology: Don' t " tip-bot for Fenghua Yu
2012-11-13 19:32 ` [PATCH v10 04/14] x86, hotplug: Support functions for CPU0 online/offline Fenghua Yu
2012-11-14 21:24   ` [tip:x86/bsp-hotplug] " tip-bot for Fenghua Yu
2012-11-13 19:32 ` [PATCH v10 05/14] x86, hotplug, suspend: Online CPU0 for suspend or hibernate Fenghua Yu
2012-11-14 21:25   ` [tip:x86/bsp-hotplug] " tip-bot for Fenghua Yu
2012-11-13 19:32 ` [PATCH v10 06/14] kernel/cpu.c: Add comment for priority in cpu_hotplug_pm_callback Fenghua Yu
2012-11-14 21:26   ` [tip:x86/bsp-hotplug] " tip-bot for Fenghua Yu
2012-11-13 19:32 ` [PATCH v10 07/14] x86-64, hotplug: Add start_cpu0() entry point to head_64.S Fenghua Yu
2012-11-14 21:27   ` [tip:x86/bsp-hotplug] " tip-bot for Fenghua Yu
2012-11-13 19:32 ` [PATCH v10 08/14] x86-32, hotplug: Add start_cpu0() entry point to head_32.S Fenghua Yu
2012-11-14 21:28   ` [tip:x86/bsp-hotplug] " tip-bot for Fenghua Yu
2012-11-13 19:32 ` [PATCH v10 09/14] x86, hotplug: Wake up CPU0 via NMI instead of INIT, SIPI, SIPI Fenghua Yu
2012-11-14 21:29   ` [tip:x86/bsp-hotplug] " tip-bot for Fenghua Yu
2012-11-13 19:32 ` [PATCH v10 10/14] x86, hotplug: During CPU0 online, enable x2apic, set_numa_node Fenghua Yu
2012-11-14 21:31   ` [tip:x86/bsp-hotplug] " tip-bot for Fenghua Yu
2012-11-15  0:24   ` tip-bot for Fenghua Yu
2012-11-13 19:32 ` [PATCH v10 11/14] x86, hotplug: The first online processor saves the MTRR state Fenghua Yu
2012-11-14 21:32   ` [tip:x86/bsp-hotplug] " tip-bot for Fenghua Yu
2012-11-15  0:25   ` tip-bot for Fenghua Yu
2012-11-13 19:32 ` [PATCH v10 12/14] x86, hotplug: Handle retrigger irq by the first available CPU Fenghua Yu
2012-11-14 21:33   ` [tip:x86/bsp-hotplug] " tip-bot for Fenghua Yu
2012-11-15  0:26   ` tip-bot for Fenghua Yu
2012-11-13 19:32 ` [PATCH v10 13/14] x86/i387.c: Initialize thread xstate only on CPU0 only once Fenghua Yu
2012-11-14 21:34   ` [tip:x86/bsp-hotplug] " tip-bot for Fenghua Yu
2012-11-15  0:27   ` tip-bot for Fenghua Yu
2012-11-13 19:32 ` [PATCH v10 14/14] x86, topology: Debug CPU00 hotplug Fenghua Yu
2012-11-14 21:35   ` [tip:x86/bsp-hotplug] x86, topology: Debug CPU0 hotplug tip-bot for Fenghua Yu
2012-11-15  0:28   ` tip-bot for Fenghua Yu
  -- strict thread matches above, loose matches on Subject: below --
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

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.