From owner-freebsd-current Fri Aug 23 14:35:43 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1651B37B400 for ; Fri, 23 Aug 2002 14:35:40 -0700 (PDT) Received: from wall.polstra.com (wall-gw.polstra.com [206.213.73.130]) by mx1.FreeBSD.org (Postfix) with ESMTP id 06C2943E77 for ; Fri, 23 Aug 2002 14:35:39 -0700 (PDT) (envelope-from jdp@polstra.com) Received: from vashon.polstra.com (vashon.polstra.com [206.213.73.13]) by wall.polstra.com (8.11.3/8.11.3) with ESMTP id g7NLZZf24768; Fri, 23 Aug 2002 14:35:36 -0700 (PDT) (envelope-from jdp@vashon.polstra.com) Received: (from jdp@localhost) by vashon.polstra.com (8.12.4/8.12.4/Submit) id g7NLZZqx088123; Fri, 23 Aug 2002 14:35:35 -0700 (PDT) (envelope-from jdp) Date: Fri, 23 Aug 2002 14:35:35 -0700 (PDT) Message-Id: <200208232135.g7NLZZqx088123@vashon.polstra.com> To: current@freebsd.org From: John Polstra Cc: phk@critter.freebsd.dk Subject: Re: how to compute the skew between TSC in SMP systems ? In-Reply-To: <30293.1030137693@critter.freebsd.dk> References: <30293.1030137693@critter.freebsd.dk> Organization: Polstra & Co., Seattle, WA Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In article <30293.1030137693@critter.freebsd.dk>, Poul-Henning Kamp wrote: > In message <200208232114.g7NLE80E087984@vashon.polstra.com>, John Polstra write > s: > >Well ... you can come pretty close. The BSD/OS kernel has code > >(conditioned on option SMP_DEBUG) that manages to sync up all TSCs in > >an N-CPU system such that the measured difference between the extremes > >is less than 100 counts. > > Was this before or after APM, ACPI, SpeedStep and all the other > crap ruined the TSC as a timecounting device ? Before, mostly. I've only tried it on various dual-CPU PIII systems, so I can't say whether it works on P4 with its clock-throttling thermal management or not. APM isn't configured into the kernel and is probably firmly disabled in the BIOS. Last I heard, BSD/OS had never heard of ACPI. Also, I have no evidence one way or the other as to whether the TSCs remain in sync over the long term. The code syncs them up once at boot time and then never touches them again. Still, the feature has come in handy when debugging certain multiprocessor situations where I really needed to know the relative ordering of events taking place on both CPUs. John -- John Polstra John D. Polstra & Co., Inc. Seattle, Washington USA "Disappointment is a good sign of basic intelligence." -- Chögyam Trungpa To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message