From owner-freebsd-current@FreeBSD.ORG Fri Aug 13 17:26:39 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 9549516A4CF for ; Fri, 13 Aug 2004 17:26:39 +0000 (GMT) Received: from mail5.speakeasy.net (mail5.speakeasy.net [216.254.0.205]) by mx1.FreeBSD.org (Postfix) with ESMTP id 787C543D1D for ; Fri, 13 Aug 2004 17:26:39 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: (qmail 14573 invoked from network); 13 Aug 2004 17:26:39 -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 17:26:38 -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 i7DHQOHD008964; Fri, 13 Aug 2004 13:26:35 -0400 (EDT) (envelope-from jhb@FreeBSD.org) From: John Baldwin To: freebsd-current@FreeBSD.org Date: Fri, 13 Aug 2004 13:26:16 -0400 User-Agent: KMail/1.6.2 References: <16668.61707.474283.639200@grasshopper.cs.duke.edu> In-Reply-To: <16668.61707.474283.639200@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: <200408131326.16412.jhb@FreeBSD.org> X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on server.baldwin.cx cc: Andrew Gallatin 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 17:26:39 -0000 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). -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org