mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
x86: always park offline CPUs
While on AMD (or Hygon) CPUs the situation isn't as bad wrt broadcasting of #MC, some "multicast" can still happen. Therefore the reasoning to park CPUs rather than fully offlining them applies everywhere. Don't retain the dependency on the "mce=" cmdline option either: That option may best be dropped as well, as not enabling MCE will result in a shutdown when #MC would otherwise be raised. Drop the global variable, using a #define (just like common code does) instead. Outside of common code, simplify expressions / code accordingly. (In common code we still have to cater for x86 wanting it different from everyone else.) Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com> Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
1 parent
4835c078e5
commit
b0597289eb
11 files changed
+11
-40
No files matched your search
@@ -436,7 +436,7 @@ static void cf_check dump_cx(unsigned char key)
|
||||
|
||||
if ( cpu_online(cpu) )
|
||||
print_acpi_power(cpu, power);
|
||||
else if ( park_offline_cpus )
|
||||
else
|
||||
printk("CPU%u parked in state %u (C%u)\n", cpu,
|
||||
power->last_state ? power->last_state->idx : 1,
|
||||
power->last_state ? power->last_state->type : 1);
|
||||
@@ -1360,7 +1360,7 @@ long set_cx_pminfo(uint32_t acpi_id, struct xen_processor_power *power)
|
||||
* If we've just learned of more available C states, wake the CPU if
|
||||
* it's parked, so it can go back to sleep in perhaps a deeper state.
|
||||
*/
|
||||
if ( park_offline_cpus && apic_id != BAD_APICID )
|
||||
if ( apic_id != BAD_APICID )
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
|
||||
@@ -443,9 +443,6 @@ void __init early_cpu_init(bool verbose)
|
||||
* here.
|
||||
*/
|
||||
|
||||
if (!(c->vendor & (X86_VENDOR_AMD | X86_VENDOR_HYGON)))
|
||||
park_offline_cpus = opt_mce;
|
||||
|
||||
/*
|
||||
* If nominal freq isn't available, use highest, thus causing NOW()
|
||||
* output to move more slowly. See preset_tsc_scale().
|
||||
|
||||
@@ -716,15 +716,8 @@ static int cf_check cpu_callback(
|
||||
rc = cpu_bank_alloc(cpu);
|
||||
break;
|
||||
|
||||
case CPU_UP_CANCELED:
|
||||
case CPU_DEAD:
|
||||
if ( !park_offline_cpus )
|
||||
cpu_bank_free(cpu);
|
||||
break;
|
||||
|
||||
case CPU_REMOVE:
|
||||
if ( park_offline_cpus )
|
||||
cpu_bank_free(cpu);
|
||||
cpu_bank_free(cpu);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -181,12 +181,8 @@ static int cf_check update_clusterinfo(
|
||||
!cond_alloc_cpumask_var(&per_cpu(scratch_mask, cpu)) )
|
||||
err = -ENOMEM;
|
||||
break;
|
||||
case CPU_UP_CANCELED:
|
||||
case CPU_DEAD:
|
||||
|
||||
case CPU_REMOVE:
|
||||
if ( park_offline_cpus == (action != CPU_REMOVE) ||
|
||||
system_state == SYS_STATE_suspend )
|
||||
break;
|
||||
if ( per_cpu(cluster_cpus, cpu) )
|
||||
{
|
||||
cpumask_clear_cpu(cpu, per_cpu(cluster_cpus, cpu));
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef __X86_PERCPU_H__
|
||||
#define __X86_PERCPU_H__
|
||||
|
||||
#define PARK_OFFLINE_CPUS_VAR
|
||||
#define park_offline_cpus true
|
||||
|
||||
/*
|
||||
* Force uses of per_cpu() with an invalid area to attempt to access the
|
||||
|
||||
@@ -25,12 +25,6 @@ DECLARE_PER_CPU(cpumask_var_t, scratch_cpumask);
|
||||
DECLARE_PER_CPU(cpumask_var_t, hpet_scratch_cpumask);
|
||||
DECLARE_PER_CPU(cpumask_var_t, send_ipi_cpumask);
|
||||
|
||||
/*
|
||||
* Do we, for platform reasons, need to actually keep CPUs online when we
|
||||
* would otherwise prefer them to be off?
|
||||
*/
|
||||
extern bool park_offline_cpus;
|
||||
|
||||
void smp_send_nmi_allbutself(void);
|
||||
|
||||
void send_IPI_mask(const cpumask_t *mask, int vector);
|
||||
|
||||
@@ -80,16 +80,12 @@ void __init set_nr_cpu_ids(unsigned int max_cpus)
|
||||
printk(XENLOG_INFO "SMP: Allowing %u CPUs (%d hotplug CPUs)\n",
|
||||
max_cpus, max_t(int, max_cpus - num_processors, 0));
|
||||
|
||||
if (!park_offline_cpus)
|
||||
tot_cpus = max_cpus;
|
||||
nr_cpu_ids = min(tot_cpus, NR_CPUS + 0u);
|
||||
if (nr_cpu_ids < num_processors)
|
||||
{
|
||||
unaccounted_cpus = true;
|
||||
if (park_offline_cpus)
|
||||
printk(XENLOG_WARNING
|
||||
"SMP: Cannot bring up %u further CPUs\n",
|
||||
num_processors - nr_cpu_ids);
|
||||
printk(XENLOG_WARNING "SMP: Cannot bring up %u further CPUs\n",
|
||||
num_processors - nr_cpu_ids);
|
||||
}
|
||||
|
||||
#ifndef nr_cpumask_bits
|
||||
|
||||
@@ -2144,8 +2144,7 @@ void asmlinkage __init noreturn __start_xen(void)
|
||||
/* Set up node_to_cpumask based on cpu_to_node[]. */
|
||||
numa_add_cpu(i);
|
||||
|
||||
if ( (park_offline_cpus || num_online_cpus() < max_cpus) &&
|
||||
!cpu_online(i) )
|
||||
if ( !cpu_online(i) )
|
||||
{
|
||||
ret = cpu_up(i);
|
||||
if ( ret != 0 )
|
||||
|
||||
+1
-3
@@ -92,9 +92,7 @@ void send_IPI_mask(const cpumask_t *mask, int vector)
|
||||
if ( system_state > SYS_STATE_smp_boot &&
|
||||
!unaccounted_cpus && !disabled_cpus && !cpu_in_hotplug_context() &&
|
||||
/* NB: get_cpu_maps lock requires enabled interrupts. */
|
||||
local_irq_is_enabled() && (cpus_locked = get_cpu_maps()) &&
|
||||
(park_offline_cpus ||
|
||||
cpumask_equal(&cpu_online_map, &cpu_present_map)) )
|
||||
local_irq_is_enabled() && (cpus_locked = get_cpu_maps()) )
|
||||
cpumask_or(scratch, mask, cpumask_of(smp_processor_id()));
|
||||
else
|
||||
{
|
||||
|
||||
@@ -67,8 +67,6 @@ DEFINE_PER_CPU_READ_MOSTLY(struct stubs, stubs);
|
||||
cpumask_t cpu_online_map __read_mostly;
|
||||
EXPORT_SYMBOL(cpu_online_map);
|
||||
|
||||
bool __read_mostly park_offline_cpus;
|
||||
|
||||
unsigned int __read_mostly nr_sockets;
|
||||
cpumask_t **__read_mostly socket_cpumask;
|
||||
static cpumask_t *secondary_socket_cpumask;
|
||||
@@ -1151,7 +1149,7 @@ static int cf_check cpu_smpboot_callback(
|
||||
break;
|
||||
case CPU_UP_CANCELED:
|
||||
case CPU_DEAD:
|
||||
cpu_smpboot_free(cpu, !park_offline_cpus);
|
||||
cpu_smpboot_free(cpu, false);
|
||||
break;
|
||||
case CPU_REMOVE:
|
||||
cpu_smpboot_free(cpu, true);
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
#include <xen/types.h>
|
||||
#include <asm/current.h>
|
||||
|
||||
#ifndef PARK_OFFLINE_CPUS_VAR
|
||||
#if !defined(PARK_OFFLINE_CPUS_VAR) && !defined(park_offline_cpus)
|
||||
/*
|
||||
* Do we, for platform reasons, need to actually keep CPUs online when we
|
||||
* would otherwise prefer them to be off?
|
||||
|
||||