Date: Tue, 09 May 2006 17:31:37 -0700 From: Tim Kientzle <kientzle@freebsd.org> To: David Xu <davidxu@freebsd.org> Cc: performance@freebsd.org, current@freebsd.org, Robert Watson <rwatson@freebsd.org>, Kris Kennaway <kris@obsecurity.org>, Greg 'groggy' Lehey <grog@freebsd.org>, freebsd-performance@freebsd.org Subject: Re: Fine-grained locking for POSIX local sockets (UNIX domain sockets) Message-ID: <44613469.2050000@freebsd.org> In-Reply-To: <200605100726.28243.davidxu@freebsd.org> References: <20060506150622.C17611@fledge.watson.org> <20060509181302.GD3636@eucla.lemis.com> <20060509182330.GB92714@xor.obsecurity.org> <200605100726.28243.davidxu@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
David Xu wrote: > On Wednesday 10 May 2006 02:23, Kris Kennaway wrote: > >>There are at least several issues here: >> >>...This may be general issues like >>gettimeofday() on Linux vs FreeBSD; clearly there is something *very >>big* to blame here. Mysql does do *lots* of such calls ... > > My last recall is that gettimeofday is not a syscall on Linux... I recall Matt talking about implementing gettimeofday() without a syscall. The basic idea is to have the kernel record some constants in a page that's mapped across all processes, then libc can just read the time from a known location. It might be nice to combine this with some of the other ideas being tossed around here: * On each clock tick, store a base time in a known location (page mapped read-only, no-execute across all memory maps) * libc can just read the base time (accurate to the clock rate) from a constant. Very, very fast. * For higher resolution, the kernel could record TSC and CPU clock speed data (per-CPU? Hmmm...) and libc could use that to fine-tune the time? Still some details I need to think through... Tim
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?44613469.2050000>