Subject: Re: inittodr/resettodr precision improvement
To: None <tech-kern@netbsd.org>
From: None <joerg@britannica.bec.de>
List: tech-kern
Date: 06/20/2006 18:39:35
On Tue, Jun 20, 2006 at 12:19:10PM -0400, Perry E. Metzger wrote:
> I'd like to propose that on most ports, we spin in inittodr(9) waiting
> for the next second to tick over and setting the clock exactly then,
> and that in resettodr(9) we do a brief calculation of when the next
> second will tick, and wait until then to set the RTC.
> 
> This has the disadvantage of adding up to a 1 second delay in machine
> pauses, boots, shutdowns, etc, but it will make timekeeping much
> better.

I'd like to see this as well, but would like to see a two step approach
as alternative option. inittodr(9) could use the callout
mechanism to learn within one second when the next second update will
happen. This can be predicted with a precision of two ticks in the worst
case. It doesn't have to spin during that time and the normal boot
process could continue. After that it just has to spin for two ticks.
As long as the boot process takes at least two seconds, it would add a
delay of at most two ticks.

Joerg