Subject: Re: FreeBSD's timecounter framework
To: <>
From: Frank Kardel <Frank.Kardel@Acrys.COM>
List: tech-kern
Date: 07/20/2005 12:15:47
Erik E. Fair wrote:
> I've spent the last month poking a Cyrix MediaGX based system, and
> correcting found bugs. One of the main ones was in the
> i8254_microtime() routine. I have a replacement for it that seems to
> work much better, but I have not yet committed it because there needs
> to be a more thorough review of NetBSD's kernel time keeping functions.
>
> I can, however, make it available, should you wish to try it.
Great, I'd like to try it.

Currently performance is abysmal to say the least. I attempted to use
the 27MHz counter. But somehow I must
have overlooked something. The improvements weren't what I expected them
to be. I can give you that code
if you are interested in that - but it does not work much better yet -
unfortunately. I'll additionally try FreeBSD.

From what I saw in PHK's timecounter code I was positively impressed.
It actually gives an abstraction to cycle counters
and knows what their  resolution and quality is. This would be a good
abstraction layer in NetBSD for timing integration.
The timecounter code comes with an adjusted ntp kernel implementation.
So it looks like a good subsystem with a
better counter abstraction then the stuff I currently see in NetBSD
(i8254, TSC, sparc counter). All seems to follow more the
adhoc model than a clean abstraction to providing time of day services
and periodic interrupts. I'd like to see the
mi-specific counters and periodic interrupt sources rather being a sort
of device that registers with the timing framework
during autoconfiguration. The time counter framework would get us pretty
close there. Maybe we should extent that
to providing periodic interrupt service and a TOY (time of year - RTC
clock) source. Then we should have everything
for the timing abstraction.

Nice to hear from you again (long time ago I saw you with NTP at Apple
if my memory serves me right)!
>
>     Erik <fair@netbsd.org>
>
Frank <kardel@{acm,ntp}.org>