[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 2/5] x86: use cpumask_any() in mask-to-APIC-ID conversions



This is to avoid picking CPU0 for almost any such operation, resulting
in very uneven distribution of interrupt load.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

--- a/xen/arch/x86/genapic/delivery.c
+++ b/xen/arch/x86/genapic/delivery.c
@@ -67,5 +67,5 @@ const cpumask_t *vector_allocation_cpuma
 unsigned int cpu_mask_to_apicid_phys(const cpumask_t *cpumask)
 {
        /* As we are using single CPU as destination, pick only one CPU here */
-       return cpu_physical_id(cpumask_first(cpumask));
+       return cpu_physical_id(cpumask_any(cpumask));
 }
--- a/xen/arch/x86/genapic/x2apic.c
+++ b/xen/arch/x86/genapic/x2apic.c
@@ -81,7 +81,7 @@ static const cpumask_t *vector_allocatio
 
 static unsigned int cpu_mask_to_apicid_x2apic_cluster(const cpumask_t *cpumask)
 {
-    unsigned int cpu = cpumask_first(cpumask);
+    unsigned int cpu = cpumask_any(cpumask);
     unsigned int dest = per_cpu(cpu_2_logical_apicid, cpu);
     const cpumask_t *cluster_cpus = per_cpu(cluster_cpus, cpu);
 



Attachment: x86-use-cpumask_any.patch
Description: Text document

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.