From: "Jan Beulich" Subject: [PATCH v2] complete conversion set_bit() -> __cpumask_set_cpu() by 4aaca0e9cd Date: Mon, 23 Feb 2015 13:47:36 +0000 Message-ID: <54EB3D880200007800062834@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part90A52268.3__=" Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YPtML-0008Fg-SW for xen-devel@lists.xenproject.org; Mon, 23 Feb 2015 13:47:41 +0000 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 , Andrew Cooper , Tim Deegan , Ian Campbell , Sander Eikelenboom , Ian Jackson 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. --=__Part90A52268.3__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline While converting to __cpumask_set_cpu() was correct, the first argument passed should have been corrected to be "cpu" instead of "nr" at once. The wrong construct results in problems on systems with relatively few CPUs. Reported-by: Sander Eikelenboom Signed-off-by: Jan Beulich --- v2: As Andrew points out the original code was wrong too, and hence the use of __cpumask_set_cpu) was correct. What was wrong was the use of "nr" as the bit position. --- a/xen/common/softirq.c +++ b/xen/common/softirq.c @@ -106,7 +106,7 @@ void cpu_raise_softirq(unsigned int cpu, if ( !per_cpu(batching, this_cpu) || in_irq() ) smp_send_event_check_cpu(cpu); else - __cpumask_set_cpu(nr, &per_cpu(batch_mask, this_cpu)); + __cpumask_set_cpu(cpu, &per_cpu(batch_mask, this_cpu)); } =20 void cpu_raise_softirq_batch_begin(void) --=__Part90A52268.3__= Content-Type: text/plain; name="cpumask-relax-fix.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="cpumask-relax-fix.patch" complete conversion set_bit() -> __cpumask_set_cpu() by 4aaca0e9cd=0A=0AWhi= le converting to __cpumask_set_cpu() was correct, the first argument=0Apass= ed should have been corrected to be "cpu" instead of "nr" at once.=0AThe = wrong construct results in problems on systems with relatively few=0ACPUs.= =0A=0AReported-by: Sander Eikelenboom =0ASigned-off-b= y: Jan Beulich =0A---=0Av2: As Andrew points out the = original code was wrong too, and hence=0A the use of __cpumask_set_cpu) = was correct. What was wrong was the=0A use of "nr" as the bit = position.=0A=0A--- a/xen/common/softirq.c=0A+++ b/xen/common/softirq.c=0A@@= -106,7 +106,7 @@ void cpu_raise_softirq(unsigned int cpu,=0A if ( = !per_cpu(batching, this_cpu) || in_irq() )=0A smp_send_event_check_= cpu(cpu);=0A else=0A- __cpumask_set_cpu(nr, &per_cpu(batch_mask,= this_cpu));=0A+ __cpumask_set_cpu(cpu, &per_cpu(batch_mask, = this_cpu));=0A }=0A =0A void cpu_raise_softirq_batch_begin(void)=0A --=__Part90A52268.3__= 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 --=__Part90A52268.3__=--