From owner-freebsd-current@FreeBSD.ORG Fri Oct 28 10:30:24 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 9CAB716A420; Fri, 28 Oct 2005 10:30:24 +0000 (GMT) (envelope-from davidxu@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6066643D45; Fri, 28 Oct 2005 10:30:24 +0000 (GMT) (envelope-from davidxu@freebsd.org) Received: from [127.0.0.1] (davidxu@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j9SAUJEp004664; Fri, 28 Oct 2005 10:30:21 GMT (envelope-from davidxu@freebsd.org) Message-ID: <4361FDBE.7000500@freebsd.org> Date: Fri, 28 Oct 2005 18:30:22 +0800 From: David Xu User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.12) Gecko/20050928 X-Accept-Language: en-us, en MIME-Version: 1.0 To: David Xu References: <30622.1130493370@critter.freebsd.dk> <4361FA1C.1070103@freebsd.org> In-Reply-To: <4361FA1C.1070103@freebsd.org> Content-Type: text/plain; charset=us-ascii; 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 10:30:24 -0000 David Xu wrote: > Poul-Henning Kamp wrote: > >> In message <4361F057.4030904@pp.nic.fi>, Pertti Kosunen writes: >> >> >>> Does polling affect to this test? >> >> >> >> Not apart from the CPU overhead. >> >> sysctl kern.timecounter.hardware >> >> is much more important. >> >> and all the reports here which fail to include it are mostly >> useless. >> >> > I suspect because our time() function in libc uses gettimeofday, > this further causes lots of gettimeofday syscall. > > Now, I can confirm mysqld calls time() function lots of time, I have changed time() to call clock_gettime, now there is few of gettimeofday in ktrace result, but fully filled by clock_gettime. Can we optimize time()? because it only returns second. may we just create a syscall to return time_second variable in kernel, this sounds crazy though.