Skip to contentSkip to conversation

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

PATCH In review Jan Beulich 2 participants 2 messages Feb 23, 2015

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 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.

---
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.

xen/common/softirq.c +1 -1
@@ -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)

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.

---
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.

xen/common/softirq.c +1 -1
@@ -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)

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

Reviewed-by on v2 1/1
#1 lore raw
Quoted 7 lines · Jan Beulich

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.

Looks better.

Quoted 19 lines

---
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.

xen/common/softirq.c +1 -1
@@ -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)