From owner-freebsd-current@FreeBSD.ORG Fri Aug 13 20:32:10 2004 Return-Path: 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 9E87016A4CE for ; Fri, 13 Aug 2004 20:32:10 +0000 (GMT) Received: from mail3.speakeasy.net (mail3.speakeasy.net [216.254.0.203]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6EB1043D2D for ; Fri, 13 Aug 2004 20:32:10 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: (qmail 19651 invoked from network); 13 Aug 2004 20:32:10 -0000 Received: from dsl027-160-063.atl1.dsl.speakeasy.net (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) encrypted SMTP for ; 13 Aug 2004 20:32:09 -0000 Received: from [10.50.40.208] (gw1.twc.weather.com [216.133.140.1]) (authenticated bits=0) by server.baldwin.cx (8.12.11/8.12.11) with ESMTP id i7DKW5ps009933; Fri, 13 Aug 2004 16:32:06 -0400 (EDT) (envelope-from jhb@FreeBSD.org) From: John Baldwin To: Andrew Gallatin Date: Fri, 13 Aug 2004 13:38:37 -0400 User-Agent: KMail/1.6.2 References: <16668.61707.474283.639200@grasshopper.cs.duke.edu> <200408131326.16412.jhb@FreeBSD.org> <16668.64083.212658.727644@grasshopper.cs.duke.edu> In-Reply-To: <16668.64083.212658.727644@grasshopper.cs.duke.edu> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200408131338.37038.jhb@FreeBSD.org> X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on server.baldwin.cx cc: freebsd-current@FreeBSD.org Subject: Re: Is the TSC timecounter safe on SMP system? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Aug 2004 20:32:10 -0000 On Friday 13 August 2004 01:28 pm, Andrew Gallatin wrote: > John Baldwin writes: > > On Friday 13 August 2004 12:49 pm, Andrew Gallatin wrote: > > > I have a system where the TSC timecounter is quite a bit more accurate > > > (or perhaps its just much cheaper) than the ACPI timecounter. This is > > > a single CPU, HTT system running an SMP kernel. > > > > > > A simple program which calls gettimeofday() in a tight loop, looking > > > for the microseconds to change sees ~998,000 microsecond updates/sec > > > with kern.timecounter.hardware=TSC, and 28,500 updates/sec with > > > ACPI-safe. > > > > > > 1) Is it safe to switch to TSC? > > > > > > 2) If yes, would it be safe to switch to TSC if this was a real > > > SMP system with multiple physical cpus? > > > > Probably not. The problem is that the TSC is not necessarily in sync > > between the CPUs so time would "jump around" as you migrated between > > CPUs. If you can get the TSC's synchronized between the CPUs and keep > > them that way then you can use the TSC (Linux does this FWIW). > > But on a single CPU HTT machine, does each HTT core reads the same TSC? I think they each have their own TSC. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org