ia64/xen-unstable

changeset 16315:070da619e65e

x86, hvm: More fixes to no-missed-tick-accounting mode.
Signed-off-by: Keir Fraser <keir@xensource.com>
author Keir Fraser <keir@xensource.com>
date Mon Nov 05 10:09:10 2007 +0000 (2007-11-05)
parents 650cadd1b283
children 28487ba2ea1e
files xen/arch/x86/hvm/vpt.c
line diff
     1.1 --- a/xen/arch/x86/hvm/vpt.c	Fri Nov 02 16:38:11 2007 +0000
     1.2 +++ b/xen/arch/x86/hvm/vpt.c	Mon Nov 05 10:09:10 2007 +0000
     1.3 @@ -47,21 +47,26 @@ static void pt_unlock(struct periodic_ti
     1.4  
     1.5  static void pt_process_missed_ticks(struct periodic_time *pt)
     1.6  {
     1.7 -    s_time_t missed_ticks;
     1.8 -
     1.9 -    if ( mode_is(pt->vcpu->domain, no_missed_tick_accounting) )
    1.10 -        return;
    1.11 +    s_time_t missed_ticks, now = NOW();
    1.12  
    1.13      if ( pt->one_shot )
    1.14          return;
    1.15  
    1.16 -    missed_ticks = NOW() - pt->scheduled;
    1.17 +    missed_ticks = now - pt->scheduled;
    1.18      if ( missed_ticks <= 0 )
    1.19          return;
    1.20  
    1.21 -    missed_ticks = missed_ticks / (s_time_t) pt->period + 1;
    1.22 -    pt->pending_intr_nr += missed_ticks;
    1.23 -    pt->scheduled += missed_ticks * pt->period;
    1.24 +    if ( mode_is(pt->vcpu->domain, no_missed_tick_accounting) )
    1.25 +    {
    1.26 +        pt->pending_intr_nr = 1;
    1.27 +        pt->scheduled = now + pt->scheduled;
    1.28 +    }
    1.29 +    else
    1.30 +    {
    1.31 +        missed_ticks = missed_ticks / (s_time_t) pt->period + 1;
    1.32 +        pt->pending_intr_nr += missed_ticks;
    1.33 +        pt->scheduled += missed_ticks * pt->period;
    1.34 +    }
    1.35  }
    1.36  
    1.37  static void pt_freeze_time(struct vcpu *v)