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-devel

[Xen-devel] [PATCH 1 of 5] credit2: Add context_saved scheduler callback

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH 1 of 5] credit2: Add context_saved scheduler callback
From: George Dunlap <george.dunlap@xxxxxxxxxxxxx>
Date: Wed, 14 Apr 2010 11:26:19 +0100
Cc: george.dunlap@xxxxxxxxxxxxx
Delivery-date: Wed, 14 Apr 2010 03:32:54 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1271240778@silas>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <patchbomb.1271240778@silas>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
2 files changed, 3 insertions(+)
xen/common/schedule.c      |    2 ++
xen/include/xen/sched-if.h |    1 +


Because credit2 shares a runqueue between several cpus, it needs
to know when a scheduled-out process has finally been context-switched
away so that it can be added to the runqueue again.  (Otherwise it may
be grabbed by another processor before the context has been properly
saved.)

Signed-off-by: George Dunlap <george.dunlap@xxxxxxxxxxxxx>

diff -r c02cc832cb2d -r 2631707c54b3 xen/common/schedule.c
--- a/xen/common/schedule.c     Tue Apr 13 18:19:33 2010 +0100
+++ b/xen/common/schedule.c     Wed Apr 14 11:16:58 2010 +0100
@@ -923,6 +923,8 @@
     /* Check for migration request /after/ clearing running flag. */
     smp_mb();
 
+    SCHED_OP(context_saved, prev);
+
     if ( unlikely(test_bit(_VPF_migrating, &prev->pause_flags)) )
         vcpu_migrate(prev);
 }
diff -r c02cc832cb2d -r 2631707c54b3 xen/include/xen/sched-if.h
--- a/xen/include/xen/sched-if.h        Tue Apr 13 18:19:33 2010 +0100
+++ b/xen/include/xen/sched-if.h        Wed Apr 14 11:16:58 2010 +0100
@@ -70,6 +70,7 @@
 
     void         (*sleep)          (struct vcpu *);
     void         (*wake)           (struct vcpu *);
+    void         (*context_saved)  (struct vcpu *);
 
     struct task_slice (*do_schedule) (s_time_t);
 

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