tech-kern archive

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

Re: timecounters



manu@ wrote:

> The NetBSD kernel can use multiple timecounters for time keeping, the
> choices available are shown by sysctl kern.timecounter.choice, and
> the chosen timecounter is decided by kern.timecounter.hardware.
> 
> It seems the alternatives, their pros and cons, are not documented.
> Did I miss it? All I found is PHK's paper referenced from timecounter(9),
> which documents TSC, i8254 and ACPI. I think it would be nice to add
> a few words about the available timecounters.

IIUC, the essencial part about these counters is in timecounter(9):

>>     A timecounter is a binary counter which has two properties:
>>           o   it runs at a fixed, known frequency; and
>>           o   it has sufficient bits to not roll over in less than
>>               approximately max(2 msec, 2/HZ seconds) (the value 2 here is
>>               really 1 + delta, for some indeterminate value of delta).

I.e.
- All MD counters have these properties
- Impliclitly higher frequency and larger bits are preferred
- tc_quality in each struct timecounter implicitly describes priorities

> clockinterrupt: not documented at all?  See sys/kern/kern_clock.c

This seems a rough counter by hardclock(9). It's avaliable on
all systems, so used as timecouneter(9) on machines that have no
MD binary counters.


Describing all MD counters is not so bad idea, but maybe we rather
want proper documentation in www.netbsd.org or timecounter(9)?

(Note I asked kardel@ about timecounter implementation many years ago
 and that was the reason why I imported and updated timecouneter(9)
 man pages per OpenBSD's tc_init(9)..)

---
Izumi Tsutsui 


Home | Main Index | Thread Index | Old Index