From owner-freebsd-current@FreeBSD.ORG Fri Aug 13 17:38:30 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 924C416A4D9 for ; Fri, 13 Aug 2004 17:38:29 +0000 (GMT) Received: from carver.gumbysoft.com (carver.gumbysoft.com [66.220.23.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8A4AA43D45 for ; Fri, 13 Aug 2004 17:38:29 +0000 (GMT) (envelope-from dwhite@gumbysoft.com) Received: by carver.gumbysoft.com (Postfix, from userid 1000) id 75EC672DD4; Fri, 13 Aug 2004 10:38:29 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by carver.gumbysoft.com (Postfix) with ESMTP id 71A1272DCB; Fri, 13 Aug 2004 10:38:29 -0700 (PDT) Date: Fri, 13 Aug 2004 10:38:29 -0700 (PDT) From: Doug White To: Andrew Gallatin In-Reply-To: <16668.61707.474283.639200@grasshopper.cs.duke.edu> Message-ID: <20040813103710.F93695@carver.gumbysoft.com> References: <16668.61707.474283.639200@grasshopper.cs.duke.edu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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:38:30 -0000 On Fri, 13 Aug 2004, 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? If you like your ticks bouncing around; you'll get different values depending on which CPU you read. > 2) If yes, would it be safe to switch to TSC if this was a real > SMP system with multiple physical cpus? TSC in a single-package HTT situation would be interesting to research, if it is shared across the pipelines. -- Doug White | FreeBSD: The Power to Serve dwhite@gumbysoft.com | www.FreeBSD.org