diff -r 115c97f32dc6 xen/common/sched_credit.c --- a/xen/common/sched_credit.c Tue Mar 10 00:18:39 2009 +0800 +++ b/xen/common/sched_credit.c Tue Mar 10 03:09:44 2009 +0800 @@ -328,7 +328,7 @@ static inline int static inline int __csched_vcpu_is_cache_hot(struct vcpu *v) { - int hot = ((NOW() - v->runstate.state_entry_time) < + int hot = ((NOW() - v->last_run_time) < ((uint64_t)vcpu_migration_delay * 1000u)); if ( hot ) diff -r 115c97f32dc6 xen/common/schedule.c --- a/xen/common/schedule.c Tue Mar 10 00:18:39 2009 +0800 +++ b/xen/common/schedule.c Tue Mar 10 03:00:36 2009 +0800 @@ -836,6 +836,7 @@ static void schedule(void) (test_bit(_VPF_blocked, &prev->pause_flags) ? RUNSTATE_blocked : (vcpu_runnable(prev) ? RUNSTATE_runnable : RUNSTATE_offline)), now); + prev->last_run_time = now; ASSERT(next->runstate.state != RUNSTATE_running); vcpu_runstate_change(next, RUNSTATE_running, now); diff -r 115c97f32dc6 xen/include/xen/sched.h --- a/xen/include/xen/sched.h Tue Mar 10 00:18:39 2009 +0800 +++ b/xen/include/xen/sched.h Tue Mar 10 02:59:15 2009 +0800 @@ -102,6 +102,9 @@ struct vcpu } runstate_guest; /* guest address */ #endif + /* last time when vCPU is scheduled out */ + uint64_t last_run_time; + /* Has the FPU been initialised? */ bool_t fpu_initialised; /* Has the FPU been used since it was last saved? */