xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xen: sched: fix spinlock issue in schedule_cpu_switch().
@ 2016-04-11 16:27 Dario Faggioli
  2016-04-11 16:38 ` George Dunlap
  0 siblings, 1 reply; 4+ messages in thread
From: Dario Faggioli @ 2016-04-11 16:27 UTC (permalink / raw)
  To: xen-devel; +Cc: Andrew Cooper, George Dunlap, Aaron Cornelius

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.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
---
Cc: George Dunlap <george.dunlap@citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Aaron Cornelius <aaron.cornelius@dornerworks.com>
---
 xen/common/schedule.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 922b035..013e5f1 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -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
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* Re: [PATCH] xen: sched: fix spinlock issue in schedule_cpu_switch().
  2016-04-11 16:27 [PATCH] xen: sched: fix spinlock issue in schedule_cpu_switch() Dario Faggioli
@ 2016-04-11 16:38 ` George Dunlap
  2016-04-11 16:59   ` Dario Faggioli
  0 siblings, 1 reply; 4+ messages in thread
From: George Dunlap @ 2016-04-11 16:38 UTC (permalink / raw)
  To: Dario Faggioli, xen-devel; +Cc: Andrew Cooper, Aaron Cornelius

On 11/04/16 17:27, Dario Faggioli wrote:
> 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.
> 
> Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>

Acked-by: George Dunlap <george.dunlap@citrix.com>

> ---
> Cc: George Dunlap <george.dunlap@citrix.com>
> Cc: Andrew Cooper <andrew.cooper3@citrix.com>
> Cc: Aaron Cornelius <aaron.cornelius@dornerworks.com>
> ---
>  xen/common/schedule.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/xen/common/schedule.c b/xen/common/schedule.c
> index 922b035..013e5f1 100644
> --- a/xen/common/schedule.c
> +++ b/xen/common/schedule.c
> @@ -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
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* Re: [PATCH] xen: sched: fix spinlock issue in schedule_cpu_switch().
  2016-04-11 16:38 ` George Dunlap
@ 2016-04-11 16:59   ` Dario Faggioli
  2016-04-11 17:09     ` Konrad Rzeszutek Wilk
  0 siblings, 1 reply; 4+ messages in thread
From: Dario Faggioli @ 2016-04-11 16:59 UTC (permalink / raw)
  To: George Dunlap, xen-devel; +Cc: Andrew Cooper, Aaron Cornelius


[-- Attachment #1.1: Type: text/plain, Size: 1048 bytes --]

On Mon, 2016-04-11 at 17:38 +0100, George Dunlap wrote:
> On 11/04/16 17:27, Dario Faggioli wrote:
> > 
> > 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.
> > 
> > Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
> Acked-by: George Dunlap <george.dunlap@citrix.com>
> 
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
-- 
<<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)


[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

[-- Attachment #2: 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] 4+ messages in thread

* Re: [PATCH] xen: sched: fix spinlock issue in schedule_cpu_switch().
  2016-04-11 16:59   ` Dario Faggioli
@ 2016-04-11 17:09     ` Konrad Rzeszutek Wilk
  0 siblings, 0 replies; 4+ messages in thread
From: Konrad Rzeszutek Wilk @ 2016-04-11 17:09 UTC (permalink / raw)
  To: Dario Faggioli; +Cc: xen-devel, Aaron Cornelius, George Dunlap, Andrew Cooper

On Mon, Apr 11, 2016 at 06:59:23PM +0200, Dario Faggioli wrote:
> On Mon, 2016-04-11 at 17:38 +0100, George Dunlap wrote:
> > On 11/04/16 17:27, Dario Faggioli wrote:
> > > 
> > > 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.
> > > 
> > > Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
> > Acked-by: George Dunlap <george.dunlap@citrix.com>
> > 
> Thanks George.

And applied.

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

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

end of thread, other threads:[~2016-04-11 17:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-11 16:27 [PATCH] xen: sched: fix spinlock issue in schedule_cpu_switch() Dario Faggioli
2016-04-11 16:38 ` George Dunlap
2016-04-11 16:59   ` Dario Faggioli
2016-04-11 17:09     ` Konrad Rzeszutek Wilk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).