Negative ping times with FreeBSD 8.1-RELEASE on older Celeron system

Brett Glass brett at
Tue Sep 13 04:43:48 UTC 2011

At 06:15 PM 9/12/2011, Chuck Swiger wrote:
>Your system's timekeeping appears to be busted.  Are you running ntpd with "tinker step 0.0" or some home-grown mechanism which might be forcibly stepping the clock rather than skewing it, by any chance?

Nothing like that.

>Anyway, the output of:
>  sysctl -a kern.timecounter
> likely to be informative.  

Here it is:

kern.timecounter.tick: 1
kern.timecounter.choice: TSC(800) ACPI-safe(850) i8254(0) dummy(-1000000)
kern.timecounter.hardware: ACPI-safe
kern.timecounter.stepwarnings: 0 4294967295 5754 1193182 0 16777215 7967112 3579545 850 4294967295 4058536290 501141177 800
kern.timecounter.invariant_tsc: 0

This is very instructive. I didn't know that FreeBSD used the Pentium internal timestamp counter for anything but profiling.

I am noticing here that the "mask" (which I assume is the maximum value just before a rollover) for the "ACPI-safe" timer is very small. Maybe it's rolling over very frequently and/or the system is missing some of the rollovers. This would cause it to calculate negative times, of course.

>Try switching to another clock type, especially ACPI-safe if it hasn't been chosen by default.  

No docs on how to do this. Is this done by, for example, setting 


in loader.conf?

>Your CPU is probably too old to have a power-state invariant TSC, but if you disable SpeedStep, powerd and similar which might change the processor frequency, TSC might work OK also.

I've already turned off all power saving mechanisms listed in the BIOs setup, including clock speed modulation. So, the TSC ought to be pretty stable. At least it's worth a shot. 

--Brett Glass

More information about the freebsd-questions mailing list