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

[Xen-changelog] [xen-unstable] Move logic for avoiding limited idle quantum into credit scheduler.



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1238678239 -3600
# Node ID 5a60eb7fad79294ca1b9e74f8da1ea1d165d3199
# Parent  085d22289e1b078f6bee808eb14209ca91c58451
Move logic for avoiding limited idle quantum into credit scheduler.

Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/common/sched_credit.c |    3 ++-
 xen/common/schedule.c     |    8 +++-----
 2 files changed, 5 insertions(+), 6 deletions(-)

diff -r 085d22289e1b -r 5a60eb7fad79 xen/common/sched_credit.c
--- a/xen/common/sched_credit.c Thu Apr 02 13:02:13 2009 +0100
+++ b/xen/common/sched_credit.c Thu Apr 02 14:17:19 2009 +0100
@@ -1146,7 +1146,8 @@ csched_schedule(s_time_t now)
     /*
      * Return task to run next...
      */
-    ret.time = MILLISECS(CSCHED_MSECS_PER_TSLICE);
+    ret.time = (is_idle_vcpu(snext->vcpu) ?
+                -1 : MILLISECS(CSCHED_MSECS_PER_TSLICE));
     ret.task = snext->vcpu;
 
     CSCHED_VCPU_CHECK(ret.task);
diff -r 085d22289e1b -r 5a60eb7fad79 xen/common/schedule.c
--- a/xen/common/schedule.c     Thu Apr 02 13:02:13 2009 +0100
+++ b/xen/common/schedule.c     Thu Apr 02 14:17:19 2009 +0100
@@ -798,7 +798,6 @@ static void schedule(void)
     s_time_t              now = NOW();
     struct schedule_data *sd;
     struct task_slice     next_slice;
-    s32                   r_time;     /* time for new dom to run */
 
     ASSERT(!in_irq());
     ASSERT(this_cpu(mc_state).flags == 0);
@@ -814,13 +813,12 @@ static void schedule(void)
     /* get policy-specific decision on scheduling... */
     next_slice = ops.do_schedule(now);
 
-    r_time = next_slice.time;
     next = next_slice.task;
 
     sd->curr = next;
 
-    if ( !is_idle_vcpu(next) )
-        set_timer(&sd->s_timer, now + r_time);
+    if ( next_slice.time >= 0 ) /* -ve means no limit */
+        set_timer(&sd->s_timer, now + next_slice.time);
 
     if ( unlikely(prev == next) )
     {
@@ -836,7 +834,7 @@ static void schedule(void)
              next->domain->domain_id,
              (next->runstate.state == RUNSTATE_runnable) ?
              (now - next->runstate.state_entry_time) : 0,
-             r_time);
+             next_slice.time);
 
     ASSERT(prev->runstate.state == RUNSTATE_running);
     vcpu_runstate_change(

_______________________________________________
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®.