Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Sep 2011 21:30:05 -0600
From:      Brett Glass <brett@lariat.net>
To:        Chuck Swiger <cswiger@mac.com>
Cc:        questions@freebsd.org
Subject:   Re: Negative ping times with FreeBSD 8.1-RELEASE on older Celeron system
Message-ID:  <201109130443.WAA23650@lariat.net>
In-Reply-To: <F06D137D-F364-46B2-9458-6882B543B3A6@mac.com>
References:  <201109122350.RAA21916@lariat.net> <F06D137D-F364-46B2-9458-6882B543B3A6@mac.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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
>
>...is 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
kern.timecounter.tc.i8254.mask: 4294967295
kern.timecounter.tc.i8254.counter: 5754
kern.timecounter.tc.i8254.frequency: 1193182
kern.timecounter.tc.i8254.quality: 0
kern.timecounter.tc.ACPI-safe.mask: 16777215
kern.timecounter.tc.ACPI-safe.counter: 7967112
kern.timecounter.tc.ACPI-safe.frequency: 3579545
kern.timecounter.tc.ACPI-safe.quality: 850
kern.timecounter.tc.TSC.mask: 4294967295
kern.timecounter.tc.TSC.counter: 4058536290
kern.timecounter.tc.TSC.frequency: 501141177
kern.timecounter.tc.TSC.quality: 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 

kern.timecounter.hardware="TSC"

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201109130443.WAA23650>