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

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



# HG changeset patch
# User Juergen Gross <juergen.gross@xxxxxxxxxxxxxx>
# Date 1316273721 -3600
# Node ID 4a401bdaeb5b2d87312fa622dd61006e993ca5b4
# Parent  3e1d3c9747f20f6d5bd1a7a04431ac4a0f0c4e39
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>
xen-unstable changeset:   23843:6684e3bafbbd
xen-unstable date:        Sat Sep 17 16:19:26 2011 +0100
---


diff -r 3e1d3c9747f2 -r 4a401bdaeb5b xen/common/schedule.c
--- a/xen/common/schedule.c     Sat Sep 17 16:31:01 2011 +0100
+++ b/xen/common/schedule.c     Sat Sep 17 16:35:21 2011 +0100
@@ -1112,7 +1112,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;
@@ -1146,6 +1146,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®.