Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Oct 2005 15:06:31 +0400 (MSD)
From:      Maxim Konovalov <maxim@macomnet.ru>
To:        Poul-Henning Kamp <phk@phk.freebsd.dk>
Cc:        Pertti Kosunen <pertti.kosunen@pp.nic.fi>, David Xu <davidxu@freebsd.org>, "Yuriy N. Shkandybin" <jura@networks.ru>, current@freebsd.org
Subject:   Re: Timers and timing, was: MySQL Performance 6.0rc1 
Message-ID:  <20051028145838.C15076@mp2.macomnet.net>
In-Reply-To: <31223.1130496616@critter.freebsd.dk>
References:  <31223.1130496616@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20051028145838.C15076>