[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] Be more sensitive to losing sync with platform timer.



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID c9fd91d7540d5bc89cb89cb4b18309054fb9d40a
# Parent  7a36f58f64ee2f53f07aff83fa4bb787859badd4
Be more sensitive to losing sync with platform timer.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>

diff -r 7a36f58f64ee -r c9fd91d7540d xen/arch/x86/time.c
--- a/xen/arch/x86/time.c       Wed Sep  7 09:50:57 2005
+++ b/xen/arch/x86/time.c       Wed Sep  7 10:04:54 2005
@@ -792,6 +792,13 @@
     tsc_elapsed64   = curr_tsc - prev_tsc;
 
     /*
+     * Weirdness can happen if we lose sync with the platform timer.
+     * We could be smarter here: resync platform timer with local timer?
+     */
+    if ( ((s64)stime_elapsed64 < (EPOCH / 2)) )
+        goto out;
+
+    /*
      * Calculate error-correction factor. This only slows down a fast local
      * clock (slow clocks are warped forwards). The scale factor is clamped
      * to >= 0.5.
@@ -854,6 +861,7 @@
     cpu_time[cpu].stime_local_stamp  = curr_local_stime;
     cpu_time[cpu].stime_master_stamp = curr_master_stime;
 
+ out:
     set_ac_timer(&cpu_time[cpu].calibration_timer, NOW() + EPOCH);
 
     if ( cpu == 0 )

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.