From owner-freebsd-questions@FreeBSD.ORG Tue Sep 13 04:43:48 2011 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2F42106564A for ; Tue, 13 Sep 2011 04:43:48 +0000 (UTC) (envelope-from brett@lariat.net) Received: from lariat.net (lariat.net [66.62.230.51]) by mx1.freebsd.org (Postfix) with ESMTP id 8C6078FC18 for ; Tue, 13 Sep 2011 04:43:48 +0000 (UTC) Received: from WildRover.lariat.net (IDENT:ppp1000.lariat.net@lariat.net [66.119.58.2] (may be forged)) by lariat.net (8.9.3/8.9.3) with ESMTP id WAA23650; Mon, 12 Sep 2011 22:43:43 -0600 (MDT) Message-Id: <201109130443.WAA23650@lariat.net> X-Mailer: QUALCOMM Windows Eudora Version 7.1.0.9 Date: Mon, 12 Sep 2011 21:30:05 -0600 To: Chuck Swiger From: Brett Glass In-Reply-To: References: <201109122350.RAA21916@lariat.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Cc: questions@freebsd.org Subject: Re: Negative ping times with FreeBSD 8.1-RELEASE on older Celeron system X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Sep 2011 04:43:48 -0000 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