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