From owner-freebsd-current@FreeBSD.ORG Fri Oct 28 11:06:33 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 E518B16A41F; Fri, 28 Oct 2005 11:06:33 +0000 (GMT) (envelope-from maxim@macomnet.ru) Received: from mp2.macomnet.net (mp2.macomnet.net [195.128.64.6]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4B2C043D45; Fri, 28 Oct 2005 11:06:32 +0000 (GMT) (envelope-from maxim@macomnet.ru) Received: from localhost (localhost [127.0.0.1]) by mp2.macomnet.net (8.13.3/8.13.3) with ESMTP id j9SB6Vnw015807; Fri, 28 Oct 2005 15:06:31 +0400 (MSD) (envelope-from maxim@macomnet.ru) Date: Fri, 28 Oct 2005 15:06:31 +0400 (MSD) From: Maxim Konovalov To: Poul-Henning Kamp In-Reply-To: <31223.1130496616@critter.freebsd.dk> Message-ID: <20051028145838.C15076@mp2.macomnet.net> References: <31223.1130496616@critter.freebsd.dk> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: Pertti Kosunen , David Xu , "Yuriy N. Shkandybin" , current@freebsd.org 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 11:06:34 -0000 On Fri, 28 Oct 2005, 12:50+0200, Poul-Henning Kamp wrote: > In message <436200BE.70604@freebsd.org>, David Xu writes: > >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. > > We have often talked about doing something like that, but so far nobody > has come up with a (sensible) implementation. > > Please thing _very_ carefully about the implications for libc > versioning before hacking up a patch. We used to use a following setup on our overloaded (a couple of millions emails per day) SMTP|LMTP|POP3 server: - a deamon calls gettimeofday(2) every 10 msec and exports the information to a sysv share memory segment; - LD_PREALOD'ed libgettimeofday.so library makes it visible to the userland. It improved the health of the server greatly. I can't call it a sensible implementation though. -- Maxim Konovalov