From owner-cvs-src@FreeBSD.ORG Tue Oct 18 18:05:35 2005 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5A58E16A420; Tue, 18 Oct 2005 18:05:35 +0000 (GMT) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.FreeBSD.org (Postfix) with ESMTP id 940DC43D45; Tue, 18 Oct 2005 18:05:34 +0000 (GMT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (unknown [192.168.48.2]) by phk.freebsd.dk (Postfix) with ESMTP id F32E7BC84; Tue, 18 Oct 2005 18:05:27 +0000 (UTC) To: Nate Lawson From: "Poul-Henning Kamp" In-Reply-To: Your message of "Tue, 18 Oct 2005 10:31:14 PDT." <43553162.5040802@root.org> Date: Tue, 18 Oct 2005 20:05:27 +0200 Message-ID: <69633.1129658727@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: Scott Long , src-committers@FreeBSD.org, Andrew Gallatin , cvs-src@FreeBSD.org, cvs-all@FreeBSD.org, David Xu Subject: Re: cvs commit: src/sys/amd64/amd64 cpu_switch.S machdep.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2005 18:05:35 -0000 In message <43553162.5040802@root.org>, Nate Lawson writes: >> The TSC represents the clock rate of the CPU, and thus can vary wildly >> when thermal and power management controls kick in, and there is no way >> to know when it changes. Because of this, I think that it's >> practically useless on Pentium-Mobile and Pentium-M chips, among many >> others. > >This is a myth. It isn't a myth. As recent as this year chips have been sent on the market which will throttle their cpu-clock and TSC on certain chip stress conditions without giving any timely indication to any part of the BIOS or OS. One major BIOS supplier still mucks up SMP TSC synchronization on certain SMM bios actions. And remember: not everybody runs intel or AMD chips. We need to work on sparc64 and alpha chips as well. Alpha is particularly nasty as some of the older chips have a SAW generated CPU clock which is not synchronized to the bus clock. >> There is also the issue of multiple CPUs having to keep their >> TSC's somewhat in sync in order to get consistent counting in the >> system. For "somewhat" read: "exact" Unless we want to do the Lamport-trick and pay the overhead of intra-cpu locks when we calculate timestamps they have to be in _exact_ synchronization _and_ syntonization. The solution to the context switch problem is _not_ to botch the timekeeping, the solution is to not _need_ the timekeeping. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.