adj_systeim()

Gary E. Miller gem at rellim.com
Sun Mar 12 23:02:06 UTC 2017


Yo Hal!

On Sat, 11 Mar 2017 23:53:17 -0800
Hal Murray <hmurray at megapathdsl.net> wrote:

> gem at rellim.com said:
> > I have been tracking a loss of precision error and found something I
> > dislike.  Eric thinks I must be mistaken, so I need a tie
> > breaker.   
> 
> I haven't checked or followed all the details, but I think you may be
> on to something.

Please check your system to see if adj_systime() is called on your
system.  Eric thinks otherwise.

> > adj_host_clock() is called once a second to correct the sysclock.  
> 
> That doesn't make sense in general.  It doesn't have any new info.
> How does it know how much to adjust by?

From the PLL state variables.

> I'd expect it to adjust the clock in response to a packet.

Not that I can see.

> Are you assuming a PPS case?

Nope.  And I am explicitly excluding PPS STA_PPSTIME mode, which is the
mode where the kernel does the PPS, not NTP.

> Does the Raspberry Pi or BBB use a hardware counter/timer to latch
> the PPS?

Nope.  Done in the kernel, just like DCD on an RS-232 line.

> > My next step is to try to figure out how to use STA_OFFSET mode
> > in=20 nanoseconds with ntp_adjtime_ns().   
> 
> It's probably worth looking at the libc code.

Nope, that is a kernel call, you gotta look at the kernel code.  
Which I have been doing: kernel/time/ntp.c

> I think if ADJ_NANO is defined, it will convert back to non-NANO if
> the kernel doesn't support NANO.

Which would be a really old kernel, and we would still be getting the
best possible.

> It may be worth checking ntp classic.  We may have lost something in
> that area during all the cleanups.

Good idea.

> Maybe we should fix all our code to use ADJ rather than MOD.

Good point.  I think the ntpd code predates any kernel code, and they
likely never went back to cleanup.

RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
	gem at rellim.com  Tel:+1 541 382 8588

	    Veritas liberabit vos. -- Quid est veritas?
    "If you can’t measure it, you can’t improve it." - Lord Kelvin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ntpsec.org/pipermail/devel/attachments/20170312/97fbdfd0/attachment.bin>


More information about the devel mailing list