ia64/xen-unstable

changeset 19502:5a60eb7fad79

Move logic for avoiding limited idle quantum into credit scheduler.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Apr 02 14:17:19 2009 +0100 (2009-04-02)
parents 085d22289e1b
children 1a7457bb1fdf
files xen/common/sched_credit.c xen/common/schedule.c
line diff
     1.1 --- a/xen/common/sched_credit.c	Thu Apr 02 13:02:13 2009 +0100
     1.2 +++ b/xen/common/sched_credit.c	Thu Apr 02 14:17:19 2009 +0100
     1.3 @@ -1146,7 +1146,8 @@ csched_schedule(s_time_t now)
     1.4      /*
     1.5       * Return task to run next...
     1.6       */
     1.7 -    ret.time = MILLISECS(CSCHED_MSECS_PER_TSLICE);
     1.8 +    ret.time = (is_idle_vcpu(snext->vcpu) ?
     1.9 +                -1 : MILLISECS(CSCHED_MSECS_PER_TSLICE));
    1.10      ret.task = snext->vcpu;
    1.11  
    1.12      CSCHED_VCPU_CHECK(ret.task);
     2.1 --- a/xen/common/schedule.c	Thu Apr 02 13:02:13 2009 +0100
     2.2 +++ b/xen/common/schedule.c	Thu Apr 02 14:17:19 2009 +0100
     2.3 @@ -798,7 +798,6 @@ static void schedule(void)
     2.4      s_time_t              now = NOW();
     2.5      struct schedule_data *sd;
     2.6      struct task_slice     next_slice;
     2.7 -    s32                   r_time;     /* time for new dom to run */
     2.8  
     2.9      ASSERT(!in_irq());
    2.10      ASSERT(this_cpu(mc_state).flags == 0);
    2.11 @@ -814,13 +813,12 @@ static void schedule(void)
    2.12      /* get policy-specific decision on scheduling... */
    2.13      next_slice = ops.do_schedule(now);
    2.14  
    2.15 -    r_time = next_slice.time;
    2.16      next = next_slice.task;
    2.17  
    2.18      sd->curr = next;
    2.19  
    2.20 -    if ( !is_idle_vcpu(next) )
    2.21 -        set_timer(&sd->s_timer, now + r_time);
    2.22 +    if ( next_slice.time >= 0 ) /* -ve means no limit */
    2.23 +        set_timer(&sd->s_timer, now + next_slice.time);
    2.24  
    2.25      if ( unlikely(prev == next) )
    2.26      {
    2.27 @@ -836,7 +834,7 @@ static void schedule(void)
    2.28               next->domain->domain_id,
    2.29               (next->runstate.state == RUNSTATE_runnable) ?
    2.30               (now - next->runstate.state_entry_time) : 0,
    2.31 -             r_time);
    2.32 +             next_slice.time);
    2.33  
    2.34      ASSERT(prev->runstate.state == RUNSTATE_running);
    2.35      vcpu_runstate_change(