[ntp:questions] reference clock, shm and ntpd

Stuart Maclean stuart at apl.washington.edu
Mon Jul 25 22:21:16 UTC 2016


Hi Pearly, all,

I have re-read the suggestions on this thread, to figure out why the use
of a shm segment and ntpd does NOT give me the same performance as a
daemon doing our own calls to adjtimex.

I am running ntpd under strace, recording just the adjtimex system call.
 Here is a typical system call made by ntpd:

adjtimex({modes=ADJ_OFFSET|0x8000, offset=5, freq=0, maxerror=16384000,
esterror=16384000, status=STA_PLL|STA_UNSYNC, constant=3, precision=1,
tolerance=33554432, time={1469483836, 57343}, tick=10000, ppsfreq=0,
jitter=200, shift=2, stabil=33554432, jitcnt=0, calcnt=0, errcnt=0,
stbcnt=0}) = 5 (TIME_ERROR)


I note with some confusion how both the 'tick' and 'freq' members of the
struct timex are both 0.  I note also the system call return of 5 where
I guess you would hope/expect a 0.

In our home-grown time adjuster, we found that a tick value of 10008 and
a varying freq value, always non-zero, did a good job of keeping Linux
system time in line with our reference clock.

Obviously ntpd is trying a completely different approach to getting
system time aligned with some reference.

Stuart


More information about the questions mailing list