All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] complete conversion set_bit() -> __cpumask_set_cpu() by 4aaca0e9cd
@ 2015-02-23 13:47 Jan Beulich
  2015-02-23 13:49 ` Andrew Cooper
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Beulich @ 2015-02-23 13:47 UTC (permalink / raw)
  To: xen-devel
  Cc: Keir Fraser, Andrew Cooper, Tim Deegan, Ian Campbell,
	Sander Eikelenboom, Ian Jackson

[-- Attachment #1: Type: text/plain, Size: 926 bytes --]

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 <linux@eikelenboom.it>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
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));
 }
 
 void cpu_raise_softirq_batch_begin(void)




[-- Attachment #2: cpumask-relax-fix.patch --]
[-- Type: text/plain, Size: 990 bytes --]

complete conversion set_bit() -> __cpumask_set_cpu() by 4aaca0e9cd

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 <linux@eikelenboom.it>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
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));
 }
 
 void cpu_raise_softirq_batch_begin(void)

[-- Attachment #3: Type: text/plain, Size: 126 bytes --]

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] complete conversion set_bit() -> __cpumask_set_cpu() by 4aaca0e9cd
  2015-02-23 13:47 [PATCH v2] complete conversion set_bit() -> __cpumask_set_cpu() by 4aaca0e9cd Jan Beulich
@ 2015-02-23 13:49 ` Andrew Cooper
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Cooper @ 2015-02-23 13:49 UTC (permalink / raw)
  To: Jan Beulich, xen-devel
  Cc: Ian Campbell, Sander Eikelenboom, Keir Fraser, Ian Jackson,
	Tim Deegan

On 23/02/15 13:47, Jan Beulich wrote:
> 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 <linux@eikelenboom.it>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Looks better.

Reviewed-by: Andrew Cooper <andrew.cooper3@citirx.com>

> ---
> 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));
>  }
>  
>  void cpu_raise_softirq_batch_begin(void)
>
>
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-02-23 13:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-23 13:47 [PATCH v2] complete conversion set_bit() -> __cpumask_set_cpu() by 4aaca0e9cd Jan Beulich
2015-02-23 13:49 ` Andrew Cooper

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.