From owner-freebsd-stable Thu Jul 22 1: 0:49 1999 Delivered-To: freebsd-stable@freebsd.org Received: from zibbi.mikom.csir.co.za (zibbi.mikom.csir.co.za [146.64.24.58]) by hub.freebsd.org (Postfix) with ESMTP id B11C615561 for ; Thu, 22 Jul 1999 01:00:39 -0700 (PDT) (envelope-from jhay@zibbi.mikom.csir.co.za) Received: (from jhay@localhost) by zibbi.mikom.csir.co.za (8.9.3/8.9.3) id JAA11291; Thu, 22 Jul 1999 09:59:00 +0200 (SAT) (envelope-from jhay) From: John Hay Message-Id: <199907220759.JAA11291@zibbi.mikom.csir.co.za> Subject: Re: Tuning the system's clock In-Reply-To: <199907220628.XAA01044@dingo.cdrom.com> from Mike Smith at "Jul 21, 1999 11:28:32 pm" To: mike@smith.net.au (Mike Smith) Date: Thu, 22 Jul 1999 09:59:00 +0200 (SAT) Cc: stable@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL54 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > > > FreeBSD's internal high-precision clock seems to be based on the > > processor's instruction cycle counter. I've found that on one machine, the > > clock is about 150 ppm fast. So I tried to reduce the machdep.tsc_freq > > value. That was bad -- instant reboot. > > The TSC is calibrated at boot time using the RTC; that calibration is > inherently limited to the accuracy of the RTC. And that is why there is a sysctl to set the frequency. It you have some means to determine the frequency better that what the kernel can do, you can set it with the sysctl. > > > Are the NTP pll values for mult/div documented anywhere? It seems to divide > > before it multiplies, which means that using them for small offsets would > > require high divisors, and hence a loss of accuracy. > > The TSC is ill-suited to precision timekeeping, as the CPU clock > frequency is not particularly precise, nor is it guaranteed to remain > at any given value (many power-management schemes adjust the CPU clock > to control power consumption). The only real use for the TSC is > accounting for total elapsed clock cycles over some code fragment (and > even that's compromised by SMM). > > If you want to do accurate timekeeping on a PC, use add-in hardware > designed for the purpose. You will find nothing in the standard PC > architecture suited to the task. You might want to talk to Poul about > the XRPU hardware that he's been using for this very task. > (phk@freebsd.org) While some of what you say is true, it depends on what you want to do. If you have a dedicated machine that you want to use as a time server, you can just disable the power management stuff. I don't claim that you can get to the accuracies that Poul-Henning is able to achieve with his hardware, but you can get to pretty decent levels with a plain dedicated FreeBSD machine, ntpd and a decent gps like the Oncore UT+. See http://stats.mikom.csir.co.za/ntp/tock/ if you want to see what is possible with such a setup and one directory back for a little more info. John -- John Hay -- John.Hay@mikom.csir.co.za To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message