Home | History | Annotate | Line # | Download | only in hints
sgi revision 1.1.1.1.28.2
      1  1.1.1.1.28.2  msaitoh adjtime, tick and tickadj:
      2  1.1.1.1.28.2  msaitoh --------------------------
      3  1.1.1.1.28.2  msaitoh 
      4  1.1.1.1.28.2  msaitoh The SGI value for HZ is 100 under Irix 4, with the system clock running
      5  1.1.1.1.28.2  msaitoh in nominal mode (ftimer off), so the value for tick is 10000 usec.
      6  1.1.1.1.28.2  msaitoh Tickadj is a bit more tricky because of the behaviour of adjtime(),
      7  1.1.1.1.28.2  msaitoh which seems to try to perform the correction over 100-200 seconds, with
      8  1.1.1.1.28.2  msaitoh a rate limit of 0.04 secs/sec for large corrections.  Corrections of
      9  1.1.1.1.28.2  msaitoh less than 0.017 seconds generally complete in less than a second,
     10  1.1.1.1.28.2  msaitoh however.
     11  1.1.1.1.28.2  msaitoh 
     12  1.1.1.1.28.2  msaitoh Some measured rates are as follows:
     13  1.1.1.1.28.2  msaitoh 
     14  1.1.1.1.28.2  msaitoh 	Delta       Rate (sec/sec)
     15  1.1.1.1.28.2  msaitoh 
     16  1.1.1.1.28.2  msaitoh 	> 1		0.04
     17  1.1.1.1.28.2  msaitoh 	0.75		0.04
     18  1.1.1.1.28.2  msaitoh 	0.6		0.004
     19  1.1.1.1.28.2  msaitoh 	0.5		0.004
     20  1.1.1.1.28.2  msaitoh 	0.4		0.0026
     21  1.1.1.1.28.2  msaitoh 	0.3		0.0026
     22  1.1.1.1.28.2  msaitoh 	0.2		0.0013
     23  1.1.1.1.28.2  msaitoh 	0.1		0.0015
     24  1.1.1.1.28.2  msaitoh 	0.05		0.0015
     25  1.1.1.1.28.2  msaitoh 	0.02		0.0003
     26  1.1.1.1.28.2  msaitoh 	0.01		0.015
     27  1.1.1.1.28.2  msaitoh Strange.  Anyway, since adjtime will complete adjustments of less than
     28  1.1.1.1.28.2  msaitoh 17msec in less than a second, whether the fast clock is on or off, I
     29  1.1.1.1.28.2  msaitoh have used a value of 150usec/tick for the tickadj value.
     30  1.1.1.1.28.2  msaitoh 
     31  1.1.1.1.28.2  msaitoh Fast clock:
     32  1.1.1.1.28.2  msaitoh -----------
     33  1.1.1.1.28.2  msaitoh 
     34  1.1.1.1.28.2  msaitoh I get smoother timekeeping if I turn on the fast clock, thereby making
     35  1.1.1.1.28.2  msaitoh the clock tick at 1kHz rather than 100Hz.  With the fast clock off, I
     36  1.1.1.1.28.2  msaitoh see a sawtooth clock offset with an amplitude of 5msec.  With it on,
     37  1.1.1.1.28.2  msaitoh the amplitude drops to 0.5msec (surprise!).  This may be a consequence
     38  1.1.1.1.28.2  msaitoh of having a local reference clock which spits out the time at exactly
     39  1.1.1.1.28.2  msaitoh one-second intervals - I am probably seeing sampling aliasing between
     40  1.1.1.1.28.2  msaitoh that and the machine clock.  This may all be irrelevant for machines
     41  1.1.1.1.28.2  msaitoh without a local reference clock.  Fiddling with the fast clock doesn't
     42  1.1.1.1.28.2  msaitoh seem to compromise the above choices for tick and tickadj.
     43  1.1.1.1.28.2  msaitoh 
     44  1.1.1.1.28.2  msaitoh I use the "ftimer" program to switch the fast clock on when the system
     45  1.1.1.1.28.2  msaitoh goes into multiuser mode, but you can set the "fastclock" flag in
     46  1.1.1.1.28.2  msaitoh /usr/sysgen/master.d/kernel to have it on by default.  See ftimer(1).
     47  1.1.1.1.28.2  msaitoh 
     48  1.1.1.1.28.2  msaitoh timetrim:
     49  1.1.1.1.28.2  msaitoh ---------
     50  1.1.1.1.28.2  msaitoh 
     51  1.1.1.1.28.2  msaitoh Irix has a kernel variable called timetrim which adjusts the system
     52  1.1.1.1.28.2  msaitoh time increment, effectively trimming the clock frequency.  Xntpd could
     53  1.1.1.1.28.2  msaitoh use this rather than adjtime() to do it's frequency trimming, but I
     54  1.1.1.1.28.2  msaitoh haven't the time to explore this.  There is a utility program,
     55  1.1.1.1.28.2  msaitoh "timetrim", in the util directory which allows manipulation of the
     56  1.1.1.1.28.2  msaitoh timetrim value in both SGI and xntpd native units.  You can fiddle with
     57  1.1.1.1.28.2  msaitoh default timetrim value in /usr/sysgen/master.d/kernel, but I think
     58  1.1.1.1.28.2  msaitoh that's ugly.  I just use xntpd to figure out the right value for
     59  1.1.1.1.28.2  msaitoh timetrim for a particular CPU and then set it using "timetrim" when
     60  1.1.1.1.28.2  msaitoh going to multiuser mode.
     61  1.1.1.1.28.2  msaitoh 
     62  1.1.1.1.28.2  msaitoh Serial I/O latency:
     63  1.1.1.1.28.2  msaitoh -------------------
     64  1.1.1.1.28.2  msaitoh 
     65  1.1.1.1.28.2  msaitoh If you use a local clock on an RS-232 line, look into the kernel
     66  1.1.1.1.28.2  msaitoh configuration stuff with regard to improving the input latency (check
     67  1.1.1.1.28.2  msaitoh out /usr/sysgen/master.d/[sduart|cdsio]).  I have a Kinemetrics OM-DC
     68  1.1.1.1.28.2  msaitoh hooked onto /dev/ttyd2 (the second CPU board RS-232 port) on an SGI
     69  1.1.1.1.28.2  msaitoh Crimson, and setting the duart_rsrv_duration flag to 0 improves things
     70  1.1.1.1.28.2  msaitoh a bit.
     71  1.1.1.1.28.2  msaitoh 
     72  1.1.1.1.28.2  msaitoh 
     73  1.1.1.1.28.2  msaitoh 12 Jan 93
     74  1.1.1.1.28.2  msaitoh Steve Clift, CSIRO Marine Labs, Hobart, Australia (clift (a] ml.csiro.au)
     75