Peter Jeremy <peterjer...@acm.org> writes:
> It's not especially important how regularly the RTC is updated, just
> that it _is_ updated.  This suggests that an alternative approach
> would be for adjtime() / ntp_adjtime() to directly call resettodr() if
> it's more than P minutes since resettodr() was last called.

It just occurred to me that resettodr() is very slow (it usually
involves writing to NVRAM over an I2C bus), so it might not be a good
idea to call it from adjtime().

> As a general comment, whilst resettodr() needs to be serialised, there
> is no need for it to block.  If thread B wants to call resettodr()
> whilst thread A is doing so, thread B can just skip the call because
> calling resettodr() twice in quick succession has no benefit.

It does if thread B set the system clock before calling resettodr()
(think ntpd -gq).  Actually, it might be a good idea to call resettodr()
any time the clock is stepped.

DES
-- 
Dag-Erling Smørgrav - d...@des.no
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"

Reply via email to