From owner-freebsd-current@FreeBSD.ORG Sat Aug 14 10:15:56 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 7DDD716A4D0; Sat, 14 Aug 2004 10:15:56 +0000 (GMT) Received: from digger1.defence.gov.au (digger1.defence.gov.au [203.5.217.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3A3BB43D2D; Sat, 14 Aug 2004 10:15:55 +0000 (GMT) (envelope-from wilkinsa@squirm.dsto.defence.gov.au) Received: from ednmsw503.dsto.defence.gov.au (ednmsw503.dsto.defence.gov.au [131.185.2.150]) by digger1.defence.gov.au with ESMTP id i7EAF8fl028652; Sat, 14 Aug 2004 19:45:08 +0930 (CST) Received: from muttley.dsto.defence.gov.au (unverified) by ednmsw503.dsto.defence.gov.au (Content Technologies SMTPRS 4.3.10) with ESMTP id ; Sat, 14 Aug 2004 19:45:45 +0930 Received: from ednex501.dsto.defence.gov.au (ednex501.dsto.defence.gov.au [131.185.2.81]) by muttley.dsto.defence.gov.au (8.11.3/8.11.3) with ESMTP id i7EAD3w19496; Sat, 14 Aug 2004 19:43:03 +0930 (CST) Received: from squirm.dsto.defence.gov.au ([131.185.40.211]) by ednex501.dsto.defence.gov.au with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id QXSXRDB8; Sat, 14 Aug 2004 19:43:00 +0930 Received: from squirm.dsto.defence.gov.au (localhost [127.0.0.1]) by squirm.dsto.defence.gov.au (8.12.11/8.12.11) with ESMTP id i7EADSME095877 ; Sat, 14 Aug 2004 19:43:28 +0930 (CST) (envelope-from wilkinsa@squirm.dsto.defence.gov.au) Received: (from wilkinsa@localhost) by squirm.dsto.defence.gov.au (8.12.11/8.12.11/Submit) id i7EADSvt095876; Sat, 14 Aug 2004 19:43:28 +0930 (CST) (envelope-from wilkinsa) Date: Sat, 14 Aug 2004 19:43:28 +0930 From: "Wilkinson, Alex" To: John Baldwin Message-ID: <20040814101328.GA95083@squirm.dsto.defence.gov.au> Mail-Followup-To: John Baldwin , freebsd-current@freebsd.org, Andrew Gallatin References: <16668.61707.474283.639200@grasshopper.cs.duke.edu> <200408131326.16412.jhb@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <200408131326.16412.jhb@FreeBSD.org> X-Message-Flag: "Beware of Outlook !" User-Agent: Mutt/1.5.6i cc: freebsd-current@freebsd.org 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: Sat, 14 Aug 2004 10:15:56 -0000 0n Fri, Aug 13, 2004 at 01:26:16PM -0400, John Baldwin wrote: 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). Can someone please elaborate on the acronym TSC ? Please no comments about google etc been there done that and it wasn't useful. - aW