1258945Srobertoadjtime, tick and tickadj:
2258945Sroberto--------------------------
3258945Sroberto
4258945SrobertoThe SGI value for HZ is 100 under Irix 4, with the system clock running
5258945Srobertoin nominal mode (ftimer off), so the value for tick is 10000 usec.
6258945SrobertoTickadj is a bit more tricky because of the behaviour of adjtime(),
7258945Srobertowhich seems to try to perform the correction over 100-200 seconds, with
8258945Srobertoa rate limit of 0.04 secs/sec for large corrections.  Corrections of
9258945Srobertoless than 0.017 seconds generally complete in less than a second,
10258945Srobertohowever.
11258945Sroberto
12258945SrobertoSome measured rates are as follows:
13258945Sroberto
14258945Sroberto	Delta       Rate (sec/sec)
15258945Sroberto
16258945Sroberto	> 1		0.04
17258945Sroberto	0.75		0.04
18258945Sroberto	0.6		0.004
19258945Sroberto	0.5		0.004
20258945Sroberto	0.4		0.0026
21258945Sroberto	0.3		0.0026
22258945Sroberto	0.2		0.0013
23258945Sroberto	0.1		0.0015
24258945Sroberto	0.05		0.0015
25258945Sroberto	0.02		0.0003
26258945Sroberto	0.01		0.015
27258945SrobertoStrange.  Anyway, since adjtime will complete adjustments of less than
28258945Sroberto17msec in less than a second, whether the fast clock is on or off, I
29258945Srobertohave used a value of 150usec/tick for the tickadj value.
30258945Sroberto
31258945SrobertoFast clock:
32258945Sroberto-----------
33258945Sroberto
34258945SrobertoI get smoother timekeeping if I turn on the fast clock, thereby making
35258945Srobertothe clock tick at 1kHz rather than 100Hz.  With the fast clock off, I
36258945Srobertosee a sawtooth clock offset with an amplitude of 5msec.  With it on,
37258945Srobertothe amplitude drops to 0.5msec (surprise!).  This may be a consequence
38258945Srobertoof having a local reference clock which spits out the time at exactly
39258945Srobertoone-second intervals - I am probably seeing sampling aliasing between
40258945Srobertothat and the machine clock.  This may all be irrelevant for machines
41258945Srobertowithout a local reference clock.  Fiddling with the fast clock doesn't
42258945Srobertoseem to compromise the above choices for tick and tickadj.
43258945Sroberto
44258945SrobertoI use the "ftimer" program to switch the fast clock on when the system
45258945Srobertogoes into multiuser mode, but you can set the "fastclock" flag in
46258945Sroberto/usr/sysgen/master.d/kernel to have it on by default.  See ftimer(1).
47258945Sroberto
48258945Srobertotimetrim:
49258945Sroberto---------
50258945Sroberto
51258945SrobertoIrix has a kernel variable called timetrim which adjusts the system
52258945Srobertotime increment, effectively trimming the clock frequency.  Xntpd could
53258945Srobertouse this rather than adjtime() to do it's frequency trimming, but I
54258945Srobertohaven't the time to explore this.  There is a utility program,
55258945Sroberto"timetrim", in the util directory which allows manipulation of the
56258945Srobertotimetrim value in both SGI and xntpd native units.  You can fiddle with
57258945Srobertodefault timetrim value in /usr/sysgen/master.d/kernel, but I think
58258945Srobertothat's ugly.  I just use xntpd to figure out the right value for
59258945Srobertotimetrim for a particular CPU and then set it using "timetrim" when
60258945Srobertogoing to multiuser mode.
61258945Sroberto
62258945SrobertoSerial I/O latency:
63258945Sroberto-------------------
64258945Sroberto
65258945SrobertoIf you use a local clock on an RS-232 line, look into the kernel
66258945Srobertoconfiguration stuff with regard to improving the input latency (check
67258945Srobertoout /usr/sysgen/master.d/[sduart|cdsio]).  I have a Kinemetrics OM-DC
68258945Srobertohooked onto /dev/ttyd2 (the second CPU board RS-232 port) on an SGI
69258945SrobertoCrimson, and setting the duart_rsrv_duration flag to 0 improves things
70258945Srobertoa bit.
71258945Sroberto
72258945Sroberto
73258945Sroberto12 Jan 93
74258945SrobertoSteve Clift, CSIRO Marine Labs, Hobart, Australia (clift@ml.csiro.au)
75