From: "Jan Beulich" Subject: [PATCH 2/5] x86: use cpumask_any() in mask-to-APIC-ID conversions Date: Fri, 23 Aug 2013 08:53:31 +0100 Message-ID: <5217311B02000078000EDE8C@nat28.tlf.novell.com> References: <5217309002000078000EDE7D@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__PartD2E19AEB.0__=" Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VCmBb-0007uC-2p for xen-devel@lists.xenproject.org; Fri, 23 Aug 2013 07:53:35 +0000 In-Reply-To: <5217309002000078000EDE7D@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel Cc: Keir Fraser List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__PartD2E19AEB.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline This is to avoid picking CPU0 for almost any such operation, resulting in very uneven distribution of interrupt load. Signed-off-by: Jan Beulich --- 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 =20 static unsigned int cpu_mask_to_apicid_x2apic_cluster(const cpumask_t = *cpumask) { - unsigned int cpu =3D cpumask_first(cpumask); + unsigned int cpu =3D cpumask_any(cpumask); unsigned int dest =3D per_cpu(cpu_2_logical_apicid, cpu); const cpumask_t *cluster_cpus =3D per_cpu(cluster_cpus, cpu); =20 --=__PartD2E19AEB.0__= Content-Type: text/plain; name="x86-use-cpumask_any.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="x86-use-cpumask_any.patch" x86: use cpumask_any() in mask-to-APIC-ID conversions=0A=0AThis is to = avoid picking CPU0 for almost any such operation, resulting=0Ain very = uneven distribution of interrupt load.=0A=0ASigned-off-by: Jan Beulich = =0A=0A--- a/xen/arch/x86/genapic/delivery.c=0A+++ = b/xen/arch/x86/genapic/delivery.c=0A@@ -67,5 +67,5 @@ const cpumask_t = *vector_allocation_cpuma=0A unsigned int cpu_mask_to_apicid_phys(const = cpumask_t *cpumask)=0A {=0A /* As we are using single CPU as destinatio= n, pick only one CPU here */=0A- return cpu_physical_id(cpumask_firs= t(cpumask));=0A+ return cpu_physical_id(cpumask_any(cpumask));=0A = }=0A--- a/xen/arch/x86/genapic/x2apic.c=0A+++ b/xen/arch/x86/genapic/x2apic= .c=0A@@ -81,7 +81,7 @@ static const cpumask_t *vector_allocatio=0A =0A = static unsigned int cpu_mask_to_apicid_x2apic_cluster(const cpumask_t = *cpumask)=0A {=0A- unsigned int cpu =3D cpumask_first(cpumask);=0A+ = unsigned int cpu =3D cpumask_any(cpumask);=0A unsigned int dest =3D = per_cpu(cpu_2_logical_apicid, cpu);=0A const cpumask_t *cluster_cpus = =3D per_cpu(cluster_cpus, cpu);=0A =0A --=__PartD2E19AEB.0__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --=__PartD2E19AEB.0__=--