WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

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

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-4.1-testing] Avoid race in schedule() when switching schedulers
From: Xen patchbot-4.1-testing <patchbot@xxxxxxx>
Date: Sat, 17 Sep 2011 18:44:09 +0100
Delivery-date: Sat, 17 Sep 2011 10:44:16 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-4.1-testing] Avoid race in schedule() when switching schedulers, Xen patchbot-4 . 1-testing <=