adj_systeim()

Hal Murray hmurray at megapathdsl.net
Sun Mar 12 07:53:17 UTC 2017


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.

> 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?

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

Are you assuming a PPS case?  Even with a PPS, you only get an adjustment 
every second with polling set to 0 which does no averaging or filtering so it 
will bounce all over the place if the PPS happens when interrupts are 
disabled.

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


> 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.

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

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

Note that there are 3 NANOs: ADJ_NANO, MOD_NANO and STA_NANO.

My Linux headers say:
/* xntp 3.4 compatibility names */
#define MOD_OFFSET      ADJ_OFFSET
#define MOD_FREQUENCY   ADJ_FREQUENCY
...

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




-- 
These are my opinions.  I hate spam.





More information about the devel mailing list