Message ID | 20190925070503.13850-2-jgross@suse.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | xen/sched: fix freeing of per-vcpu data | expand |
On 25.09.2019 09:05, Juergen Gross wrote: > The arinc653 scheduler's free_vdata() function is missing proper > locking: as it is modifying the scheduler's private vcpu list it needs > to take the scheduler lock during that operation. > > Signed-off-by: Juergen Gross <jgross@suse.com> Reviewed-by: Jan Beulich <jbeulich@suse.com> (and maybe also Suspected-by)
On Wed, 2019-09-25 at 09:05 +0200, Juergen Gross wrote: > The arinc653 scheduler's free_vdata() function is missing proper > locking: as it is modifying the scheduler's private vcpu list it > needs > to take the scheduler lock during that operation. > > Signed-off-by: Juergen Gross <jgross@suse.com> > Reviewed-by: Dario Faggioli <dfaggioli@suse.com> Regards
On 25.09.19 12:59, Dario Faggioli wrote: > On Wed, 2019-09-25 at 09:05 +0200, Juergen Gross wrote: >> The arinc653 scheduler's free_vdata() function is missing proper >> locking: as it is modifying the scheduler's private vcpu list it >> needs >> to take the scheduler lock during that operation. >> >> Signed-off-by: Juergen Gross <jgross@suse.com> >> > Reviewed-by: Dario Faggioli <dfaggioli@suse.com> As this patch is a prerequisite for my core scheduling series I'd really appreciate if it could be committed rather sooner than later. Josh, Robert, could you please comment? Or is Dario's R-b (and Jan's as well) enough in this rather simple and obvious case? Juergen
On 27.09.2019 09:23, Jürgen Groß wrote: > On 25.09.19 12:59, Dario Faggioli wrote: >> On Wed, 2019-09-25 at 09:05 +0200, Juergen Gross wrote: >>> The arinc653 scheduler's free_vdata() function is missing proper >>> locking: as it is modifying the scheduler's private vcpu list it >>> needs >>> to take the scheduler lock during that operation. >>> >>> Signed-off-by: Juergen Gross <jgross@suse.com> >>> >> Reviewed-by: Dario Faggioli <dfaggioli@suse.com> > > As this patch is a prerequisite for my core scheduling series I'd really > appreciate if it could be committed rather sooner than later. > > Josh, Robert, could you please comment? > > Or is Dario's R-b (and Jan's as well) enough in this rather simple and > obvious case? I was more or less planning to time out on waiting for their ack later today. Jan
On 27.09.19 10:20, Jan Beulich wrote: > On 27.09.2019 09:23, Jürgen Groß wrote: >> On 25.09.19 12:59, Dario Faggioli wrote: >>> On Wed, 2019-09-25 at 09:05 +0200, Juergen Gross wrote: >>>> The arinc653 scheduler's free_vdata() function is missing proper >>>> locking: as it is modifying the scheduler's private vcpu list it >>>> needs >>>> to take the scheduler lock during that operation. >>>> >>>> Signed-off-by: Juergen Gross <jgross@suse.com> >>>> >>> Reviewed-by: Dario Faggioli <dfaggioli@suse.com> >> >> As this patch is a prerequisite for my core scheduling series I'd really >> appreciate if it could be committed rather sooner than later. >> >> Josh, Robert, could you please comment? >> >> Or is Dario's R-b (and Jan's as well) enough in this rather simple and >> obvious case? > > I was more or less planning to time out on waiting for their ack > later today. Thanks. Juergen
diff --git a/xen/common/sched_arinc653.c b/xen/common/sched_arinc653.c index 72b988ea5f..d47b747ef4 100644 --- a/xen/common/sched_arinc653.c +++ b/xen/common/sched_arinc653.c @@ -442,16 +442,22 @@ a653sched_alloc_vdata(const struct scheduler *ops, struct vcpu *vc, void *dd) static void a653sched_free_vdata(const struct scheduler *ops, void *priv) { + a653sched_priv_t *sched_priv = SCHED_PRIV(ops); arinc653_vcpu_t *av = priv; + unsigned long flags; if (av == NULL) return; + spin_lock_irqsave(&sched_priv->lock, flags); + if ( !is_idle_vcpu(av->vc) ) list_del(&av->list); xfree(av); update_schedule_vcpus(ops); + + spin_unlock_irqrestore(&sched_priv->lock, flags); } /**
The arinc653 scheduler's free_vdata() function is missing proper locking: as it is modifying the scheduler's private vcpu list it needs to take the scheduler lock during that operation. Signed-off-by: Juergen Gross <jgross@suse.com> --- xen/common/sched_arinc653.c | 6 ++++++ 1 file changed, 6 insertions(+)