Bug 127484

Summary: [timecounters] Drift problem with FreeBSD 7.0 and 7.1 PRERELEASE
Product: Base System Reporter: Torbjorn Granlund <tg.at.swox.com>
Component: amd64Assignee: freebsd-amd64 (Nobody) <amd64>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description Torbjorn Granlund freebsd_committer freebsd_triage 2008-09-18 22:40:01 UTC
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?
Comment 1 pvanberlo 2008-09-27 08:52:00 UTC
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
Comment 2 pvanberlo 2008-10-12 09:50:55 UTC
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
Comment 3 Torbjorn Granlund 2008-10-12 18:40:24 UTC
"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
Comment 4 Alexander Motin freebsd_committer freebsd_triage 2010-07-12 08:11:37 UTC
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
Comment 5 Alexander Motin freebsd_committer freebsd_triage 2010-07-12 08:13:58 UTC
State Changed
From-To: open->closed

Hardware issue. Not a FreeBSD bug.