From nobody@FreeBSD.org  Thu Sep 18 21:38:07 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B2720106567D
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 18 Sep 2008 21:38:07 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id A01A88FC1C
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 18 Sep 2008 21:38:07 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m8ILc7Pa083869
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 18 Sep 2008 21:38:07 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.2/8.14.1/Submit) id m8ILc75d083868;
	Thu, 18 Sep 2008 21:38:07 GMT
	(envelope-from nobody)
Message-Id: <200809182138.m8ILc75d083868@www.freebsd.org>
Date: Thu, 18 Sep 2008 21:38:07 GMT
From: Torbjorn Granlund <tg.at.swox.com@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Drift problem with FreeBSD 7.0 and 7.1 PRERELEASE
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         127484
>Category:       amd64
>Synopsis:       [timecounters] Drift problem with FreeBSD 7.0 and 7.1 PRERELEASE
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-amd64
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Sep 18 21:40:01 UTC 2008
>Closed-Date:    Mon Jul 12 07:14:42 UTC 2010
>Last-Modified:  Mon Jul 12 07:20:03 UTC 2010
>Originator:     Torbjorn Granlund
>Release:        7.0, 7.1 PRERELEASE
>Organization:
>Environment:
FreeBSD carlos.gmplib.org 7.1-PRERELEASE FreeBSD 7.1-PRERELEASE #0: Tue Sep 16 22:32:59 CEST 2008     root@carlos.gmplib.org:/usr/src/sys/amd64/compile/GENERIC  amd64

>Description:
The clock on this system goes several percent too slowly.

I have tried all available timecounters (the default HPET, as well as
ACPI-safe and i8254.  TSC strangely says (-100) which might suggest
it is not reliable on this system.

The clock drift problem seems to be exactly the same with all
timecounters.

I have also tried setting kern.hz to 100 (in /boot/loader.conf) without
any improvements.

kern.timecounter.choice: TSC(-100) HPET(900) ACPI-safe(850) i8254(0) dummy(-1000000)

Motherboard: ASUS M3A78-EMH HDMI
CPU: AMD Phenom 9750  (2.4 GHz x 4)

I have run FreeBSD for 13 years on countless systems and have never
experienced clock drift problems with it.  Could this be a hardware
problem?
>How-To-Repeat:

>Fix:


>Release-Note:
>Audit-Trail:

From: "Paul van Berlo" <pvanberlo@fastmail.fm>
To: bug-followup@FreeBSD.org, tg.at.swox.com@FreeBSD.org
Cc:  
Subject: Re: amd64/127484: [timecounters] Drift problem with FreeBSD 7.0 and 7.1
 PRERELEASE
Date: Sat, 27 Sep 2008 09:52:00 +0200

 Hello,
 
 I'm experiencing the exact same issue on 7.0/amd64. I have an Asrock
 A780FullDisplayPort mainboard (with an AMD Athlon64 X2 CPU, CnQ
 disabled, so the CPU doesn't throttle and always runs at 2.0Ghz, tested
 with both ACPI HPET enabled and disabled in bios), and looking at NTP it
 appears my clock is between 1-3 seconds slow each time it synchronizes.
 
 kern.timecounter.choice: TSC(-100) HPET(900) ACPI-safe(850) i8254(0)
 dummy(-1000000)
 
 I tried setting kern.timecounter.hardware to HPET (default), ACPI-safe
 and i8254. Neither of these solved the issue. I also set kern.hz=100
 which didn't solve the issue either.
 
 27 Sep 08:52:07 ntpd[761]: ntpd exiting on signal 15
 27 Sep 08:53:25 ntpd[761]: synchronized to 194.171.167.130, stratum=1
 27 Sep 08:53:27 ntpd[761]: time reset +1.365546 s
 27 Sep 08:54:38 ntpd[761]: synchronized to 194.171.167.130, stratum=1
 27 Sep 09:08:46 ntpd[761]: synchronized to 194.109.153.91, stratum=3
 27 Sep 09:08:48 ntpd[761]: synchronized to 194.171.167.130, stratum=1
 27 Sep 09:16:20 ntpd[761]: time reset +2.359489 s
 27 Sep 09:16:20 ntpd[761]: kernel time sync enabled 2001
 27 Sep 09:17:32 ntpd[761]: synchronized to 194.109.153.91, stratum=3
 27 Sep 09:17:32 ntpd[761]: synchronized to 194.171.167.130, stratum=1
 27 Sep 09:30:40 ntpd[761]: synchronized to 194.171.167.130, stratum=1
 27 Sep 09:38:10 ntpd[761]: time reset +2.907558 s
 27 Sep 09:39:21 ntpd[761]: synchronized to 194.171.167.130, stratum=1
 
 Best regards,
 
 Paul van Berlo

From: "Paul van Berlo" <pvanberlo@fastmail.fm>
To: bug-followup@FreeBSD.org, tg@swox.com
Cc:  
Subject: Re: amd64/127484: [timecounters] Drift problem with FreeBSD 7.0 and 7.1
 PRERELEASE
Date: Sun, 12 Oct 2008 10:50:55 +0200

 Hi,
 
 the issue I was seeing is solved. It appears this is due to a specific
 BIOS setting (FSB Spread Spectrum), which was set to 'Auto' in my case.
 I disabled this, and now my clock runs absolutely fine. There should not
 be any side effects with disabling this option AFAIK.
 
 Thanks.
 
 
 Best regards,
 
 Paul van Berlo

From: Torbjorn Granlund <tg@swox.com>
To: "Paul van Berlo" <pvanberlo@fastmail.fm>
Cc: bug-followup@FreeBSD.org
Subject: Re: amd64/127484: [timecounters] Drift problem with FreeBSD 7.0 and 7.1 PRERELEASE
Date: Sun, 12 Oct 2008 19:40:24 +0200

 "Paul van Berlo" <pvanberlo@fastmail.fm> writes:
 
   the issue I was seeing is solved. It appears this is due to a specific
   BIOS setting (FSB Spread Spectrum), which was set to 'Auto' in my case.
   I disabled this, and now my clock runs absolutely fine. There should not
   be any side effects with disabling this option AFAIK.
 =20=20
 Thanks!
 
 My ASUS board didn't have any such option, but it had some
 "Overclocking" option which was set to "Auto".  I changed this to
 "Standard".  The clock now runs about 20 times closer to reality,
 which is enough for ntpd to work.
 
 I wonder if there is anything FreeBSD can do to work around these
 silly overclock options.  One would really wish the BIOS defaults
 would be more conservative, and leave it to the tinkerers to play
 around with overclock options.
 
 --=20
 Torbj=F6rn
State-Changed-From-To: open->closed 
State-Changed-By: mav 
State-Changed-When: Mon Jul 12 07:13:58 UTC 2010 
State-Changed-Why:  
Hardware issue. Not a FreeBSD bug. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=127484 

From: Alexander Motin <mav@FreeBSD.org>
To: bug-followup@FreeBSD.org, tg.at.swox.com@FreeBSD.org
Cc:  
Subject: Re: amd64/127484: [timecounters] Drift problem with FreeBSD 7.0 and
 7.1 PRERELEASE
Date: Mon, 12 Jul 2010 10:11:37 +0300

 On some AMD chipsets enabling Spread Spectrum makes HPET to run few
 percents slower then reported by hardware. It is official chipset errata
 and it should be handled by BIOS SMI code.
 
 -- 
 Alexander Motin
>Unformatted:
