From owner-cvs-all Wed Feb 5 23:16: 9 2003 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 99ED837B401; Wed, 5 Feb 2003 23:16:06 -0800 (PST) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id C162F43FBD; Wed, 5 Feb 2003 23:16:04 -0800 (PST) (envelope-from bde@zeta.org.au) Received: from katana.zip.com.au (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id SAA02573; Thu, 6 Feb 2003 18:15:55 +1100 Date: Thu, 6 Feb 2003 18:18:31 +1100 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: "Greg 'groggy' Lehey" Cc: Poul-Henning Kamp , , , Subject: Re: cvs commit: src/sys/i386/include clock.h src/sys/i386/i386 tsc.c In-Reply-To: <20030206004940.GH26321@wantadilla.lemis.com> Message-ID: <20030206174018.R72201-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, 6 Feb 2003, Greg 'groggy' Lehey wrote: > On Wednesday, 5 February 2003 at 1:20:40 -0800, Poul-Henning Kamp wrote: > > phk 2003/02/05 01:20:40 PST > > > > Modified files: > > sys/i386/include clock.h > > sys/i386/i386 tsc.c > > Log: > > i386/i386/tsc.c was repo-copied from i386/isa/clock.c. > > > > Remove all the stuff that does not relate to the TSC. > > > > Change the calibration to use DELAY(1000000) rather than trying to check > > it against the CMOS RTC, this drastically increases precision: Please commit changes separately from removals. This change is actually null unless certain CLK_*CALIBRATION* options are configured, and has no significant effect on precision when they are, since one of them calibrates DELAY() relative to the RTC. > > Using 25 samples on a Athlon 700MHz UP machine I find: > > > > stddev min max average > > CMOS 22200 Hz -74980 Hz 34301 Hz 704928721 Hz > > DELAY 1805 Hz -1984 Hz 2678 Hz 704937583 Hz > > > > (The difference between the two averages is not statistically significant.) This increase of precision is probably only apparent. On at least one of my systems (Abit BXII), measurements over several days show that the clock used by DELAY() (the i8254) uses a scaled version of the same hardware clock as the TSC, since the precision of the TSC relative to the i8254 appears to be arbitrarily good. However, precise measurements of these clocks turn out to be essentially useless except probably for phk's nonstandard hardware, since the accuracy of these clocks is much worse than their precision. Drift of 10-100 parts per million for a 10 degree temperature change is normal. So calibrations more precise than this are not useful. > Does this get rid of the "microuptime went backwards" problem? No. It is unrelated. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message