From owner-freebsd-current@FreeBSD.ORG Fri Oct 28 13:08:03 2005 Return-Path: X-Original-To: current@freebsd.org 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 6050B16A41F; Fri, 28 Oct 2005 13:08:03 +0000 (GMT) (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 DE1AA43D45; Fri, 28 Oct 2005 13:08:02 +0000 (GMT) (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 7A23A46B29; Fri, 28 Oct 2005 09:08:01 -0400 (EDT) Date: Fri, 28 Oct 2005 14:08:01 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: David Xu In-Reply-To: <436200BE.70604@freebsd.org> Message-ID: <20051028140556.W20147@fledge.watson.org> References: <31129.1130495688@critter.freebsd.dk> <436200BE.70604@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Pertti Kosunen , Poul-Henning Kamp , current@freebsd.org, "Yuriy N. Shkandybin" Subject: Re: Timers and timing, was: MySQL Performance 6.0rc1 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: Fri, 28 Oct 2005 13:08:03 -0000 On Fri, 28 Oct 2005, David Xu wrote: > Poul-Henning Kamp wrote: >> In message <4361FDBE.7000500@freebsd.org>, David Xu writes: >> >> the correct way to optimize this would be to add a time(2) systemcall >> which returns the value of the kernel global time_second. > > Can we make a page in kernel address space which is readable my user > code? put the variable in the page, I know read an integer is atomic-op, > needn't lock, so syscall is not needed. This approach has a lot of merit, as we can also potentially export other information there (such as kernel preferences for system call mechanisms). On the other hand, a lower risk change might be to simply add a new CLOCK_ type for lower resolution, and have a timer synchronize a variable to the system clock once every 1/10 of a second. This avoids having to muck with VM layout, etc. Robert N M Watson