Skip to contentSkip to conversation

xen: sched: fix spinlock issue in schedule_cpu_switch().

PATCH In review Dario Faggioli 3 participants 4 messages Apr 11, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen: sched: fix spinlock issue in schedule_cpu_switch().

Commit 94734ab7c3f5 ("xen: sched: close potential races when switching scheduler to CPUs") buggily replaced a call to pcpu_schedule_lock_irq() with just pcpu_schedule_lock(), causing the relevant irq_safe vs. non-irq_safe ASSERT() in check_lock() to trigger.

Fix that.

---
Cc: George Dunlap <[email protected]>
Cc: Andrew Cooper <[email protected]>
Cc: Aaron Cornelius <[email protected]>

---
 xen/common/schedule.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/common/schedule.c +1 -1
index 922b035..013e5f1 100644
@@ -1702,7 +1702,7 @@ int schedule_cpu_switch(unsigned int cpu, struct cpupool *c)
      * that the lock itself changed, and retry acquiring the new one (which
      * will be the correct, remapped one, at that point).
      */
-    old_lock = pcpu_schedule_lock(cpu);
+    old_lock = pcpu_schedule_lock_irq(cpu);
 
     vpriv_old = idle->sched_priv;
     ppriv_old = per_cpu(schedule_data, cpu).sched_priv;

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

Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Dario Faggioli

Commit 94734ab7c3f5 ("xen: sched: close potential races when switching scheduler to CPUs") buggily replaced a call to pcpu_schedule_lock_irq() with just pcpu_schedule_lock(), causing the relevant irq_safe vs. non-irq_safe ASSERT() in check_lock() to trigger.

Fix that.

Quoted 14 lines

---
Cc: George Dunlap <[email protected]>
Cc: Andrew Cooper <[email protected]>
Cc: Aaron Cornelius <[email protected]>

---
 xen/common/schedule.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/common/schedule.c +0 -0
index 922b035..013e5f1 100644

xen/common/schedule.c int schedule_cpu_switch(unsigned int cpu, struct cpupool *c) · line 1708

Quoted 8 lines
xen/common/schedule.c +1 -1
@@ -1702,7 +1702,7 @@ int schedule_cpu_switch(unsigned int cpu, struct cpupool *c)
      * that the lock itself changed, and retry acquiring the new one (which
      * will be the correct, remapped one, at that point).
      */
-    old_lock = pcpu_schedule_lock(cpu);
+    old_lock = pcpu_schedule_lock_irq(cpu);
 
     vpriv_old = idle->sched_priv;
     ppriv_old = per_cpu(schedule_data, cpu).sched_priv;

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

#2 lore raw
Quoted 8 lines · George Dunlap
Quoted 7 lines · Dario Faggioli

Commit 94734ab7c3f5 ("xen: sched: close potential races when switching scheduler to CPUs") buggily replaced a call to pcpu_schedule_lock_irq() with just pcpu_schedule_lock(), causing the relevant irq_safe vs. non-irq_safe ASSERT() in check_lock() to trigger.

Quoted 5 lines
Quoted 3 lines

Fix that.

Thanks George.

Sorry again for the issue, and sorry if it did take longer.

I said "Monday morning", but this morning my test box was otherwise busy, and this time, I really wanted to make sure I tested this on a debug build! :-P

Dario

Signature · 4 lines
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)

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

#3 lore raw
Quoted 9 lines · Dario Faggioli
Quoted 8 lines · George Dunlap
Quoted 7 lines · Dario Faggioli

Commit 94734ab7c3f5 ("xen: sched: close potential races when switching scheduler to CPUs") buggily replaced a call to pcpu_schedule_lock_irq() with just pcpu_schedule_lock(), causing the relevant irq_safe vs. non-irq_safe ASSERT() in check_lock() to trigger.

Quoted 6 lines
Quoted 5 lines
Quoted 3 lines

Fix that.

Thanks George.

And applied.

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