Subject: Re: probing CPU speed?
To: None <port-i386@netbsd.org>
From: Charles M. Hannum <root@ihack.net>
List: port-i386
Date: 11/19/1998 11:04:29
One thing to keep in mind here is that the kernel, in general, cannot
reliably use a cycle counter for anything internal.

The reason for this is that PCs do at least two forms of clock
slewing: `deturbo' mode and actual clock division inside the CPU for
power management.  If you rely on cycle counts for timing, the code
will malfunction under these conditions.

This is why I (yes, I) deliberately designed the x86 port to always
use a free-running counter (the timer chip) for timing, and never rely
on the CPU.  Other systems do actually use the CPU for timing, and
what they've found is that it loses in a bunch of different ways --
devices don't work correctly, the global clock loses time, etc.  I
would be very perturbed if we picked up these problems.