From owner-freebsd-stable@FreeBSD.ORG Thu Jul 7 09:58:02 2011 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA57A1065672 for ; Thu, 7 Jul 2011 09:58:02 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from QMTA11.westchester.pa.mail.comcast.net (qmta11.westchester.pa.mail.comcast.net [76.96.59.211]) by mx1.freebsd.org (Postfix) with ESMTP id 8918D8FC13 for ; Thu, 7 Jul 2011 09:58:02 +0000 (UTC) Received: from omta11.westchester.pa.mail.comcast.net ([76.96.62.36]) by QMTA11.westchester.pa.mail.comcast.net with comcast id 4xwl1h0010mv7h05Bxy20d; Thu, 07 Jul 2011 09:58:02 +0000 Received: from koitsu.dyndns.org ([67.180.84.87]) by omta11.westchester.pa.mail.comcast.net with comcast id 4xy11h00A1t3BNj3Xxy2S7; Thu, 07 Jul 2011 09:58:02 +0000 Received: by icarus.home.lan (Postfix, from userid 1000) id 4DEC8102C36; Thu, 7 Jul 2011 02:58:00 -0700 (PDT) Date: Thu, 7 Jul 2011 02:58:00 -0700 From: Jeremy Chadwick To: Aristedes Maniatis Message-ID: <20110707095800.GA6295@icarus.home.lan> References: <4E157EB9.4030201@ish.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4E157EB9.4030201@ish.com.au> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-stable Subject: Re: system internal timer runs 10 times too slow X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jul 2011 09:58:03 -0000 On Thu, Jul 07, 2011 at 07:39:05PM +1000, Aristedes Maniatis wrote: > We upgraded an existing system to a new motherboard/CPU and found that timing in various programs is very odd. For example "top" only updates every 10 seconds instead of every second. And this confirms the oddness: > > # while true; do echo `date`; sleep 1; done > Thu Jul 7 19:09:01 EST 2011 > Thu Jul 7 19:09:11 EST 2011 > Thu Jul 7 19:09:21 EST 2011 > > 10 seconds instead of 1. > > > So I looked first at the kernel timers: > > # dmesg | grep -i time > Timecounter "i8254" frequency 1193182 Hz quality 0 > Timecounter "ACPI-fast" frequency 3579545 Hz quality 1000 > acpi_timer0: <24-bit timer at 3.579545MHz> port 0x808-0x80b on acpi0 > pci3: at device 0.1 (no driver attached) > atrtc0: port 0x70-0x71 irq 8 on acpi0 > acpi_hpet0: iomem 0xfed00000-0xfed003ff on acpi0 > Timecounter "HPET" frequency 14318180 Hz quality 900 > Timecounters tick every 1.000 msec > > > I switched i8254 and then to HPET. No difference. > > # sysctl -w kern.timecounter.hardware=i8254 > kern.timecounter.hardware: ACPI-fast -> i8254 > # while true; do echo `date`; sleep 1; done > Thu Jul 7 19:09:40 EST 2011 > Thu Jul 7 19:09:41 EST 2011 > > I switched to TSC: > > # sysctl -w kern.timecounter.hardware=TSC > kern.timecounter.hardware: HPET -> TSC > # while true; do echo `date`; sleep 1; done > Thu Jul 7 19:25:56 EST 2011 > Thu Jul 7 19:25:57 EST 2011 > Thu Jul 7 19:25:58 EST 2011 > > Now this looks like it fixed the problem, but actually it is worse. Now the clock matches what you'd expect, but there is still 10 seconds in real time between those date entries. That is, now the system clock is running 10 times too slow as well. > > > # uname -a > FreeBSD delish.ish.com.au 8.2-RELEASE FreeBSD 8.2-RELEASE #0: Thu Feb 17 02:41:51 UTC 2011 root@mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64 > > Base board information > Manufacturer: ASUSTeK Computer INC. > Product Name: P6X58D-E > > BIOS information > Vendor: American Megatrends Inc. > Version: 0502 > Release Date: 11/16/2010 > BIOS Revision: 8.15 > > CPU Model: Intel(R) Core(TM) i7 CPU 960 @ 3.20GHz Do you have anything like powerd(8) enabled, or EIST / Intel SpeedStep technology enabled in your system BIOS? If so, can you try disabling powerd and/or disabling EIST/SS? Alternately, and this isn't to say FreeBSD doesn't have a problem, do you have a replacement/spare motherboard you can try? There's always the possibility that you have a bad crystal on the motherboard and a replacement board would rule that out. -- | Jeremy Chadwick jdc at parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, US | | Making life hard for others since 1977. PGP 4BD6C0CB |