Port-vax archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: PSA: Clock drift and pkgin



On Thu, 14 Dec 2023, Anders Magnusson wrote:

> > As for the high frequency clock in the VAX, I'm not sure it is used at all
> > by NetBSD. But it's been quite a while since I was digging around, and if
> > someone knows it is being used, I'd be happy to hear. But I think we have
> > several problems that should be sorted. And for me, the first one would be
> > to understand how on earth we can be spending so much time in system mode
> > when we do anything.
> I'm quite sure that all VAXen that have a hires clock uses it in time
> difference calculations.
> There are two of them; the ICR version and the clock chip version. See clock.c
> for more info.

 Thanks for the pointer.  Hmm, indeed we have this:

#if VAX46 || VAXANY
static struct timecounter vax_diag_tc = {
	.tc_get_timecount = vax_diag_get_counter,
	.tc_counter_mask = ~0u,
	.tc_frequency = 1000000,
	.tc_name = "diagtimer",
	.tc_quality = 100,
};
#endif

but the frequency recorded in this structure does not correspond to one in 
hardware, which is 2^26/68.26s => 983136Hz, according to the KA46 spec.  I 
need to rebuild the kernel anyway as sadly GENERIC doesn't have the TC-USB 
option enabled, so I'll see if fixing the frequency changes things anyhow.

 NB NTP still coping on lizzie though jitter reached 350 - 540 at times.  
It also keeps resyncing rather than staying steadily in sync as with my 
other machines, which is a sign of the clock drift jumping back and forth. 
Normally ntpd should stabilise asymptotically over time as it figures out 
the drift and adapts the actual measure of the system clock tick interval.

 It also records the drift observed in /var/db/ntp.drift, so once it has 
been calculated accurately enough no further resyncs are supposed to 
happen even if the daemon has been restarted, as upon restart it reads the 
value previously calculated in that file and starts from there.

  Maciej


Home | Main Index | Thread Index | Old Index