From owner-freebsd-current@FreeBSD.ORG Wed May 10 10:11:23 2006 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 B5A8416A444; Wed, 10 May 2006 10:11:23 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from mail16.syd.optusnet.com.au (mail16.syd.optusnet.com.au [211.29.132.197]) by mx1.FreeBSD.org (Postfix) with ESMTP id C7D8743D46; Wed, 10 May 2006 10:11:22 +0000 (GMT) (envelope-from peterjeremy@optushome.com.au) Received: from turion.vk2pj.dyndns.org (c220-239-19-236.belrs4.nsw.optusnet.com.au [220.239.19.236]) by mail16.syd.optusnet.com.au (8.12.11/8.12.11) with ESMTP id k4AABKCE015137 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Wed, 10 May 2006 20:11:20 +1000 Received: from turion.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by turion.vk2pj.dyndns.org (8.13.6/8.13.6) with ESMTP id k4AABJhH001372; Wed, 10 May 2006 20:11:19 +1000 (EST) (envelope-from peter@turion.vk2pj.dyndns.org) Received: (from peter@localhost) by turion.vk2pj.dyndns.org (8.13.6/8.13.6/Submit) id k4AABJP8001371; Wed, 10 May 2006 20:11:19 +1000 (EST) (envelope-from peter) Date: Wed, 10 May 2006 20:11:19 +1000 From: Peter Jeremy To: Suleiman Souhlal Message-ID: <20060510101119.GB700@turion.vk2pj.dyndns.org> Mail-Followup-To: Peter Jeremy , Suleiman Souhlal , freebsd-performance@freebsd.org, current@freebsd.org References: <20060506150622.C17611@fledge.watson.org> <200605090335.00451.hadara@bsd.ee> <20060509004203.GA55852@xor.obsecurity.org> <200605091818.12676.hadara@bsd.ee> <4460D2CA.5090808@elischer.org> <20060509183127.GD17515@retch.ugcs.caltech.edu> <4461A77F.5080508@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4461A77F.5080508@FreeBSD.org> X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.11 Cc: freebsd-performance@freebsd.org, current@freebsd.org Subject: Re: Fine-grained locking for POSIX local sockets (UNIX domain sockets) 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: Wed, 10 May 2006 10:11:23 -0000 On Wed, 2006-May-10 10:42:39 +0200, Suleiman Souhlal wrote: >That's not enough. On some CPUs (like the current Opterons), the TSC >slows down when the CPU executes a HLT instruction, so if you want good >accuracy, you'll need to take that into account too. The CPU can't be executing any instructions whilst it's halted. All you need to do is update the base time/TSC count between when you exit halt and when you return to userland. Since most sane code doesn't call gettimeofday() multiple times per tick, one option might be to unmap the page when the base data becomes invalid and update/remap the page when it is first accessed. -- Peter Jeremy