From owner-freebsd-performance@FreeBSD.ORG Wed May 10 00:31:42 2006 Return-Path: X-Original-To: performance@freebsd.org Delivered-To: freebsd-performance@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CEE8D16A40A; Wed, 10 May 2006 00:31:42 +0000 (UTC) (envelope-from kientzle@freebsd.org) Received: from kientzle.com (h-66-166-149-50.snvacaid.covad.net [66.166.149.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6409343D45; Wed, 10 May 2006 00:31:42 +0000 (GMT) (envelope-from kientzle@freebsd.org) Received: from [10.0.0.221] (p54.kientzle.com [66.166.149.54]) by kientzle.com (8.12.9/8.12.9) with ESMTP id k4A0VbOZ058953; Tue, 9 May 2006 17:31:38 -0700 (PDT) (envelope-from kientzle@freebsd.org) Message-ID: <44613469.2050000@freebsd.org> Date: Tue, 09 May 2006 17:31:37 -0700 From: Tim Kientzle User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.12) Gecko/20060422 X-Accept-Language: en-us, en MIME-Version: 1.0 To: David Xu References: <20060506150622.C17611@fledge.watson.org> <20060509181302.GD3636@eucla.lemis.com> <20060509182330.GB92714@xor.obsecurity.org> <200605100726.28243.davidxu@freebsd.org> In-Reply-To: <200605100726.28243.davidxu@freebsd.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Wed, 10 May 2006 01:37:11 +0000 Cc: performance@freebsd.org, current@freebsd.org, Robert Watson , Kris Kennaway , Greg 'groggy' Lehey , freebsd-performance@freebsd.org Subject: Re: Fine-grained locking for POSIX local sockets (UNIX domain sockets) X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 May 2006 00:31:44 -0000 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