From owner-freebsd-current@FreeBSD.ORG Fri Oct 14 16:34:58 2005 Return-Path: X-Original-To: freebsd-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 818D116A41F for ; Fri, 14 Oct 2005 16:34:58 +0000 (GMT) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id AE91843D48 for ; Fri, 14 Oct 2005 16:34:55 +0000 (GMT) (envelope-from andre@freebsd.org) Received: (qmail 35445 invoked from network); 14 Oct 2005 16:04:39 -0000 Received: from dotat.atdotat.at (HELO [62.48.0.47]) ([62.48.0.47]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 14 Oct 2005 16:04:39 -0000 Message-ID: <434FDE2B.8090502@freebsd.org> Date: Fri, 14 Oct 2005 18:34:51 +0200 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8b) Gecko/20050217 MIME-Version: 1.0 To: Eric Anderson References: <200510131412.23525.max@love2party.net> <20051013181026.GB27418@odin.ac.hmc.edu> <20051014091004.GC18513@uk.tiscali.com> <20051014.085816.104604949.imp@bsdimp.com> <434FDAB2.7040402@centtech.com> In-Reply-To: <434FDAB2.7040402@centtech.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-current@freebsd.org Subject: Re: ufsstat - testers / feedback wanted! 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, 14 Oct 2005 16:34:58 -0000 Eric Anderson wrote: > M. Warner Losh wrote: > >> In message: <20051014091004.GC18513@uk.tiscali.com> >> Brian Candler writes: >> : On Thu, Oct 13, 2005 at 11:10:26AM -0700, Brooks Davis wrote: >> : > > I don't think you can measure one single interger (or 64bit) >> increase in face : > > of a operation that has to access backing >> store. Even if there is a : > > performance hit, you don't have to >> build your kernel with the option enabled. >> : > : > The one thing I'd be worried about here is that 64bit updates are >> : > expensive on 32bit machines if you want them to be atomic. >> Relative to >> : > backing store they probably still don't matter, but the might be >> : > noticable. >> : : I'd be grateful if you could clarify that point for me. Are you >> saying that >> : if I write >> : : long long foo; >> : ... >> : foo++; >> : : then the C compiler generates code for 'foo++' which is not >> thread-safe? >> : (And therefore I would have to protect it with a mutex or critical >> section) >> : : Or are you saying that the C compiler inserts its own code around >> foo++ to >> : turn it into a critical section, and therefore runs less efficiently >> than >> : you'd expect? >> >> You have to protect this thread-unsafe operation yourself. > > > For statistics gathering purposes though, should I worry about this, or > go for 'fast and imperfect' instead of 'perfect and slow'? With > filesystems, I think it's more important to leave performance high and > get a notion of the statistics, rather than impact performance for > perfect stats (that you may only look at occasionally anyhow). If you make it a #define macro then you can leave the choice for the compile time. Fast and lose when i++ and safe and slow when atomic_inc(&i, 1). -- Andre