[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] Avoid race in schedule() when switching schedulers



# HG changeset patch
# User Juergen Gross <juergen.gross@xxxxxxxxxxxxxx>
# Date 1316272766 -3600
# Node ID 6684e3bafbbdb031e08fe330e762c4d5f5bcf535
# Parent  483c5f8319adafd61510d3a1ea085a7aec329a2d
Avoid race in schedule() when switching schedulers

Selecting the scheduler to call must be done under lock. Otherwise a
race might occur when switching schedulers in a cpupool

Signed-off-by: Juergen Gross <juergen.gross@xxxxxxxxxxxxxx>
Acked-by: George Dunlap <george.dunlap@xxxxxxxxxxxxx>
---


diff -r 483c5f8319ad -r 6684e3bafbbd xen/common/schedule.c
--- a/xen/common/schedule.c     Fri Sep 16 12:19:26 2011 +0100
+++ b/xen/common/schedule.c     Sat Sep 17 16:19:26 2011 +0100
@@ -1107,7 +1107,7 @@
 {
     struct vcpu          *prev = current, *next = NULL;
     s_time_t              now = NOW();
-    struct scheduler     *sched = this_cpu(scheduler);
+    struct scheduler     *sched;
     unsigned long        *tasklet_work = &this_cpu(tasklet_work_to_do);
     bool_t                tasklet_work_scheduled = 0;
     struct schedule_data *sd;
@@ -1141,6 +1141,7 @@
     stop_timer(&sd->s_timer);
     
     /* get policy-specific decision on scheduling... */
+    sched = this_cpu(scheduler);
     next_slice = sched->do_schedule(sched, now, tasklet_work_scheduled);
 
     next = next_slice.task;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.