commit 2d9cee2b37319714e07e6f8b4044c0db44cc8e7d Author: Juergen Gross Date: Tue Jul 28 09:28:35 2015 +0200 xen: use simple topology on demand As the cpuid information is currently taken from the physical cpu the current virtual cpu is running on, the topology information derived from the cpuid is potentially useless. In order to avoid insane scheduling decisions based on random data provide a possibility to set topology data to a very simple scheme making all cpus appear to be independent from each other. Signed-off-by: Juergen Gross diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c index 8648438..a57e816 100644 --- a/arch/x86/xen/smp.c +++ b/arch/x86/xen/smp.c @@ -55,6 +55,25 @@ static irqreturn_t xen_call_function_interrupt(int irq, void *dev_id); static irqreturn_t xen_call_function_single_interrupt(int irq, void *dev_id); static irqreturn_t xen_irq_work_interrupt(int irq, void *dev_id); +static bool xen_simple_topology; +static __init int xen_parse_topology(char *arg) +{ + xen_simple_topology = true; + return 0; +} +early_param("xen_simple_topology", xen_parse_topology); + +static void xen_set_cpu_sibling_map(int cpu) +{ + if (xen_simple_topology) { + cpumask_set_cpu(cpu, topology_sibling_cpumask(cpu)); + cpumask_set_cpu(cpu, cpu_llc_shared_mask(cpu)); + cpumask_set_cpu(cpu, topology_core_cpumask(cpu)); + } else { + set_cpu_sibling_map(cpu); + } +} + /* * Reschedule call back. */ @@ -82,7 +101,7 @@ static void cpu_bringup(void) cpu = smp_processor_id(); smp_store_cpu_info(cpu); cpu_data(cpu).x86_max_cores = 1; - set_cpu_sibling_map(cpu); + xen_set_cpu_sibling_map(cpu); xen_setup_cpu_clockevents(); @@ -333,7 +352,7 @@ static void __init xen_smp_prepare_cpus(unsigned int max_cpus) zalloc_cpumask_var(&per_cpu(cpu_core_map, i), GFP_KERNEL); zalloc_cpumask_var(&per_cpu(cpu_llc_shared_map, i), GFP_KERNEL); } - set_cpu_sibling_map(0); + xen_set_cpu_sibling_map(0); if (xen_smp_intr_init(0)) BUG();