commit 3240f68a08511c3db616cfc2a653e6761e23ff7f Author: Dario Faggioli Date: Tue Aug 18 08:41:38 2015 -0700 xen: if on Xen, "flatten" the scheduling domain hierarchy With this patch applied, only one scheduling domain is created (called the 'VCPU' domain) spanning all the guest's vCPUs. This is because, since vCPUs are moving around on pCPUs, there is no point in building a full hierarchy, based *any* topology information, which will just never be accurate. Having only one "flat" domain is really the only thing that looks sensible. Signed-off-by: Dario Faggioli diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c index 8648438..34f39f1 100644 --- a/arch/x86/xen/smp.c +++ b/arch/x86/xen/smp.c @@ -55,6 +55,21 @@ 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); +const struct cpumask *xen_pcpu_sched_domain_mask(int cpu) +{ + return cpu_online_mask; +} + +static struct sched_domain_topology_level xen_sched_domain_topology[] = { + { xen_pcpu_sched_domain_mask, SD_INIT_NAME(VCPU) }, + { NULL, }, +}; + +static void xen_set_sched_topology(void) +{ + set_sched_topology(xen_sched_domain_topology); +} + /* * Reschedule call back. */ @@ -335,6 +350,8 @@ static void __init xen_smp_prepare_cpus(unsigned int max_cpus) } set_cpu_sibling_map(0); + xen_set_sched_topology(); + if (xen_smp_intr_init(0)) BUG();