From owner-freebsd-current@FreeBSD.ORG Fri Aug 13 17:28:57 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 1D01016A4CE; Fri, 13 Aug 2004 17:28:57 +0000 (GMT) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9812243D49; Fri, 13 Aug 2004 17:28:56 +0000 (GMT) (envelope-from gallatin@cs.duke.edu) Received: from grasshopper.cs.duke.edu (grasshopper.cs.duke.edu [152.3.145.30]) by duke.cs.duke.edu (8.12.10/8.12.10) with ESMTP id i7DHSuJt004764 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 13 Aug 2004 13:28:56 -0400 (EDT) Received: (from gallatin@localhost) by grasshopper.cs.duke.edu (8.12.9p2/8.12.9/Submit) id i7DHSpdM090769; Fri, 13 Aug 2004 13:28:51 -0400 (EDT) (envelope-from gallatin) From: Andrew Gallatin MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16668.64083.212658.727644@grasshopper.cs.duke.edu> Date: Fri, 13 Aug 2004 13:28:51 -0400 (EDT) To: John Baldwin In-Reply-To: <200408131326.16412.jhb@FreeBSD.org> References: <16668.61707.474283.639200@grasshopper.cs.duke.edu> <200408131326.16412.jhb@FreeBSD.org> X-Mailer: VM 6.75 under 21.1 (patch 12) "Channel Islands" XEmacs Lucid 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 17:28:57 -0000 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? Drew