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