ia64/xen-unstable

changeset 19313:cfacba42091c

Improve vcpu_migration_delay handling.

Signed-off-by: Xiaowei Yang <xiaowei.yang@intel.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Mar 11 10:12:14 2009 +0000 (2009-03-11)
parents 2cd96ef83996
children 20a2e3f724d5
files xen/common/sched_credit.c xen/common/schedule.c xen/include/xen/sched.h
line diff
     1.1 --- a/xen/common/sched_credit.c	Wed Mar 11 10:10:15 2009 +0000
     1.2 +++ b/xen/common/sched_credit.c	Wed Mar 11 10:12:14 2009 +0000
     1.3 @@ -328,7 +328,7 @@ integer_param("vcpu_migration_delay", vc
     1.4  static inline int
     1.5  __csched_vcpu_is_cache_hot(struct vcpu *v)
     1.6  {
     1.7 -    int hot = ((NOW() - v->runstate.state_entry_time) <
     1.8 +    int hot = ((NOW() - v->last_run_time) <
     1.9                 ((uint64_t)vcpu_migration_delay * 1000u));
    1.10  
    1.11      if ( hot )
     2.1 --- a/xen/common/schedule.c	Wed Mar 11 10:10:15 2009 +0000
     2.2 +++ b/xen/common/schedule.c	Wed Mar 11 10:12:14 2009 +0000
     2.3 @@ -836,6 +836,7 @@ static void schedule(void)
     2.4          (test_bit(_VPF_blocked, &prev->pause_flags) ? RUNSTATE_blocked :
     2.5           (vcpu_runnable(prev) ? RUNSTATE_runnable : RUNSTATE_offline)),
     2.6          now);
     2.7 +    prev->last_run_time = now;
     2.8  
     2.9      ASSERT(next->runstate.state != RUNSTATE_running);
    2.10      vcpu_runstate_change(next, RUNSTATE_running, now);
     3.1 --- a/xen/include/xen/sched.h	Wed Mar 11 10:10:15 2009 +0000
     3.2 +++ b/xen/include/xen/sched.h	Wed Mar 11 10:12:14 2009 +0000
     3.3 @@ -102,6 +102,9 @@ struct vcpu
     3.4      } runstate_guest; /* guest address */
     3.5  #endif
     3.6  
     3.7 +    /* last time when vCPU is scheduled out */
     3.8 +    uint64_t last_run_time;
     3.9 +
    3.10      /* Has the FPU been initialised? */
    3.11      bool_t           fpu_initialised;
    3.12      /* Has the FPU been used since it was last saved? */