From owner-freebsd-current@FreeBSD.ORG Tue Apr 24 12:25:07 2007 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 04E4116A402; Tue, 24 Apr 2007 12:25:07 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.freebsd.org (Postfix) with ESMTP id 9E91F13C45E; Tue, 24 Apr 2007 12:25:06 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id 1E5C646BE9; Tue, 24 Apr 2007 08:25:06 -0400 (EDT) Date: Tue, 24 Apr 2007 13:25:06 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: David G Lawrence In-Reply-To: <20070424042102.GI38475@tnn.dglawrence.com> Message-ID: <20070424132155.T39145@fledge.watson.org> References: <20070423113400.GC28587@gw.humppa.dk> <462CD251.9060105@freebsd.org> <20070423161711.GV39474@elvis.mu.org> <462D821F.6030707@freebsd.org> <20070424042102.GI38475@tnn.dglawrence.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Tim Kientzle , current@freebsd.org, "Jesper B. Rosenkilde" Subject: Re: Suggestions on Avoiding syscall Overhead X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Tue, 24 Apr 2007 12:25:07 -0000 On Mon, 23 Apr 2007, David G Lawrence wrote: > gettimeofday(2) returns microsecond precision, so I don't see how this > could be made accelerated via a mapped global page. time(3) [which is > currently a wrapper for gettimeofday(2)], on the other had, could be put > into such a page since it only updates once a second. If we do this, we will need to be careful, perhaps just in documentation, as it leads to non-monotonicity if multiple time sources are queried sequentially. On systems with reliable hardware characteristics, such as in Mac OS X, precision time querying is supported by providing a kernel-exported estimate of the TSC->realtime rate and offset. This allows zero-system call querying of quite accurate time information. I believe in Mac OS X, this information is exported using a shared memory page so that the cost of getting that information is also low. Robert N M Watson Computer Laboratory University of Cambridge