From owner-freebsd-current@FreeBSD.ORG Fri Oct 28 13:26:07 2005 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from [127.0.0.1] (localhost [127.0.0.1]) by hub.freebsd.org (Postfix) with ESMTP id BD13B16A41F; Fri, 28 Oct 2005 13:26:00 +0000 (GMT) (envelope-from davidxu@freebsd.org) Message-ID: <436226AF.10109@freebsd.org> Date: Fri, 28 Oct 2005 21:25:03 +0800 From: David Xu User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.7.10) Gecko/20050806 X-Accept-Language: en-us, en MIME-Version: 1.0 To: ticso@cicely.de References: <31129.1130495688@critter.freebsd.dk> <436200BE.70604@freebsd.org> <20051028125828.GE66456@cicely12.cicely.de> In-Reply-To: <20051028125828.GE66456@cicely12.cicely.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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:26:08 -0000 Bernd Walter wrote: >On Fri, Oct 28, 2005 at 06:43:10PM +0800, 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. >> >> > >Don't whink it is importent for 1s intervalls, but atomic != coherent. > > > That's just an idea. :-) As robert said, add a lower resolution CLOCK_ type may work well. Another thing I just though of, if reading timercounter is so slow, won't gettimeofday hardly block cpu too many cycles ? the cpu is just stucked there by a slow clock in hardware signals.