From owner-svn-src-head@FreeBSD.ORG Fri Jun 22 14:24:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 348421065670; Fri, 22 Jun 2012 14:24:21 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 073888FC0A; Fri, 22 Jun 2012 14:24:21 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 4A5F1B96C; Fri, 22 Jun 2012 10:24:20 -0400 (EDT) From: John Baldwin To: Marius Strobl Date: Fri, 22 Jun 2012 09:57:01 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p13; KDE/4.5.5; amd64; ; ) References: <201206220713.q5M7DVH0063098@svn.freebsd.org> <20120622073455.GE69382@alchemy.franken.de> In-Reply-To: <20120622073455.GE69382@alchemy.franken.de> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201206220957.01341.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 22 Jun 2012 10:24:20 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Konstantin Belousov Subject: Re: svn commit: r237434 - in head/lib/libc: amd64/sys gen i386/sys include sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jun 2012 14:24:21 -0000 On Friday, June 22, 2012 3:34:56 am Marius Strobl wrote: > On Fri, Jun 22, 2012 at 07:13:31AM +0000, Konstantin Belousov wrote: > > Author: kib > > Date: Fri Jun 22 07:13:30 2012 > > New Revision: 237434 > > URL: http://svn.freebsd.org/changeset/base/237434 > > > > Log: > > Use struct vdso_timehands data to implement fast gettimeofday(2) and > > clock_gettime(2) functions if supported. The speedup seen in > > microbenchmarks is in range 4x-7x depending on the hardware. > > > > Only amd64 and i386 architectures are supported. Libc uses rdtsc and > > kernel data to calculate current time, if enabled by kernel. > > I don't know much about x86 CPUs but is my understanding correct > that TSCs are not synchronized in any way across CPUs, i.e. > reading it on different CPUs may result in time going backwards > etc., which is okay for this application though? Hmm, in practice I have found that on modern x86 CPUs (Penryn and later) the TSC is in fact sychronized across packages at work. At least, when I measure skew across packages it appears to be consistent with the time it would take a write to propagate from one to the other. -- John Baldwin