ia64/xen-unstable

changeset 6672:c9fd91d7540d

Be more sensitive to losing sync with platform timer.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Wed Sep 07 10:04:54 2005 +0000 (2005-09-07)
parents 7a36f58f64ee
children a75b08af8d19
files xen/arch/x86/time.c
line diff
     1.1 --- a/xen/arch/x86/time.c	Wed Sep 07 09:50:57 2005 +0000
     1.2 +++ b/xen/arch/x86/time.c	Wed Sep 07 10:04:54 2005 +0000
     1.3 @@ -792,6 +792,13 @@ static void local_time_calibration(void 
     1.4      tsc_elapsed64   = curr_tsc - prev_tsc;
     1.5  
     1.6      /*
     1.7 +     * Weirdness can happen if we lose sync with the platform timer.
     1.8 +     * We could be smarter here: resync platform timer with local timer?
     1.9 +     */
    1.10 +    if ( ((s64)stime_elapsed64 < (EPOCH / 2)) )
    1.11 +        goto out;
    1.12 +
    1.13 +    /*
    1.14       * Calculate error-correction factor. This only slows down a fast local
    1.15       * clock (slow clocks are warped forwards). The scale factor is clamped
    1.16       * to >= 0.5.
    1.17 @@ -854,6 +861,7 @@ static void local_time_calibration(void 
    1.18      cpu_time[cpu].stime_local_stamp  = curr_local_stime;
    1.19      cpu_time[cpu].stime_master_stamp = curr_master_stime;
    1.20  
    1.21 + out:
    1.22      set_ac_timer(&cpu_time[cpu].calibration_timer, NOW() + EPOCH);
    1.23  
    1.24      if ( cpu == 0 )