Author: cperciva
Date: Sat Dec 11 22:33:33 2010
New Revision: 216385
URL: http://svn.freebsd.org/changeset/base/216385

Log:
  Reduce the Xen timecounter from 1GHz to 2^-9 GHz, thereby increasing the
  timecounter period from 2^32 ns (~4.3s) to 2^41 ns (~36m39s).  Some time
  sharing systems can skip clock interrupts for a few seconds when under
  load (e.g., if we've recently used more than our fair share of CPU and
  someone else wants a burst of CPU) and we were losing time in quanta of
  2^32 ns due to timecounter wrapping.
  
  Increasing the timecounter period up to 2^41 ns is definitely overkill,
  but we still have microsecond timecounter precision, and anyone using
  paravirtualized hardware when they need submicrosecond timing is crazy.

Modified:
  head/sys/i386/xen/clock.c

Modified: head/sys/i386/xen/clock.c
==============================================================================
--- head/sys/i386/xen/clock.c   Sat Dec 11 22:13:29 2010        (r216384)
+++ head/sys/i386/xen/clock.c   Sat Dec 11 22:33:33 2010        (r216385)
@@ -523,7 +523,8 @@ startrtclock()
        set_cyc2ns_scale(cpu_khz/1000);
        tsc_freq = cpu_khz * 1000;
 
-        timer_freq = xen_timecounter.tc_frequency = 1000000000LL;
+        timer_freq = 1000000000LL;
+       xen_timecounter.tc_frequency = timer_freq >> 9;
         tc_init(&xen_timecounter);
 
        rdtscll(alarm);
@@ -830,7 +831,7 @@ xen_get_timecount(struct timecounter *tc
        
         clk = shadow->system_timestamp + get_nsec_offset(shadow);
 
-       return (uint32_t)(clk);
+       return (uint32_t)(clk >> 9);
 
 }
 
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to