diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2009-04-02 14:17:19 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2009-04-02 14:17:19 +0100 |
commit | c806877d1b3992a9a75e4aa7604911d048891410 (patch) | |
tree | dd875e75d5be3c6a55a509e8726d0f19ef78b216 | |
parent | e295a5ce4b7bb2b8f774fbc576bab45ab6663bc9 (diff) | |
download | xen-c806877d1b3992a9a75e4aa7604911d048891410.tar.gz xen-c806877d1b3992a9a75e4aa7604911d048891410.tar.bz2 xen-c806877d1b3992a9a75e4aa7604911d048891410.zip |
Move logic for avoiding limited idle quantum into credit scheduler.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
-rw-r--r-- | xen/common/sched_credit.c | 3 | ||||
-rw-r--r-- | xen/common/schedule.c | 8 |
2 files changed, 5 insertions, 6 deletions
diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c index c554c8b8b9..67ff04647f 100644 --- a/xen/common/sched_credit.c +++ b/xen/common/sched_credit.c @@ -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 --git a/xen/common/schedule.c b/xen/common/schedule.c index 23807ea330..fb2464f11d 100644 --- a/xen/common/schedule.c +++ b/xen/common/schedule.c @@ -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( |