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 2] scheduler: Add a per-scheduler yield callback

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH 1 of 2] scheduler: Add a per-scheduler yield callback
From: George Dunlap <george.dunlap@xxxxxxxxxxxxx>
Date: Mon, 9 Aug 2010 12:20:50 +0100
Cc: george.dunlap@xxxxxxxxxxxxx
Delivery-date: Mon, 09 Aug 2010 04:25:40 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1281352849@gdunlap-desktop>
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.1281352849@gdunlap-desktop>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mercurial-patchbomb/1.4.3
Signed-off-by: George Dunlap <george.dunlap@xxxxxxxxxxxxx>

diff -r 6f07d9ac1e7c -r 1c9288cd2af3 xen/common/schedule.c
--- a/xen/common/schedule.c     Thu Aug 05 14:41:14 2010 +0100
+++ b/xen/common/schedule.c     Fri Aug 06 15:41:56 2010 +0100
@@ -641,6 +641,12 @@
 /* Voluntarily yield the processor for this allocation. */
 static long do_yield(void)
 {
+    struct vcpu * v=current;
+
+    vcpu_schedule_lock_irq(v);
+    SCHED_OP(VCPU2OP(v), yield, v);
+    vcpu_schedule_unlock_irq(v);
+
     TRACE_2D(TRC_SCHED_YIELD, current->domain->domain_id, current->vcpu_id);
     raise_softirq(SCHEDULE_SOFTIRQ);
     return 0;
diff -r 6f07d9ac1e7c -r 1c9288cd2af3 xen/include/xen/sched-if.h
--- a/xen/include/xen/sched-if.h        Thu Aug 05 14:41:14 2010 +0100
+++ b/xen/include/xen/sched-if.h        Fri Aug 06 15:41:56 2010 +0100
@@ -107,6 +107,7 @@
 
     void         (*sleep)          (const struct scheduler *, struct vcpu *);
     void         (*wake)           (const struct scheduler *, struct vcpu *);
+    void         (*yield)           (const struct scheduler *, struct vcpu *);
     void         (*context_saved)  (const struct scheduler *, struct vcpu *);
 
     struct task_slice (*do_schedule) (const struct scheduler *, s_time_t,

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

<Prev in Thread] Current Thread [Next in Thread>