Current-Users archive

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

Re: Weird clock behaviour with current (amd64) kernel



On Sat, Aug 13, 2022 at 10:15:30PM +0700, Robert Elz wrote:
> 
> The result:  "not much" if anything at all.

If you boot the kernel in debug mode (netbsd -x), you may see
output like:


[     1.000003] cpu0: TSC freq from delay 2521276800 Hz

maybe also something like:
[     XXXXXXXX] cpu0: TSC freq from CPUID XXXXXXXXXX Hz

[     1.057594] cpu0: TSC freq from HPET 2491906000 Hz
[     1.957885] cpu1: TSC skew=8 drift=0
[     2.014612] cpu2: TSC skew=34 drift=4
[     2.181611] cpu3: TSC skew=34 drift=4
[     2.291306] timecounter: Timecounter "TSC" frequency 2491906000 Hz quality 3000


"from delay" is the first calibration against the i8254 timer.
"from CPUID" is a value that the CPU reports.
"from HPET" is a second calibration against the HPET timer.


The patch should improve the accuracy of the "from delay" value. It's
also the only place that could have been influenced by e.g. console
output.

If you have a working HPET, the second calibration should be better.
Here it always returns exactly the same number.


Greetings,
-- 
                                Michael van Elst
Internet: mlelstv%serpens.de@localhost
                                "A potential Snark may lurk in every tree."


Home | Main Index | Thread Index | Old Index