From owner-freebsd-current@FreeBSD.ORG Sat Jul 29 23:02:15 2006 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 89F9816A4DE for ; Sat, 29 Jul 2006 23:02:15 +0000 (UTC) (envelope-from jd@ugcs.caltech.edu) Received: from groat.ugcs.caltech.edu (groat.ugcs.caltech.edu [131.215.176.110]) by mx1.FreeBSD.org (Postfix) with ESMTP id 464F543D45 for ; Sat, 29 Jul 2006 23:02:15 +0000 (GMT) (envelope-from jd@ugcs.caltech.edu) Received: by groat.ugcs.caltech.edu (Postfix, from userid 3640) id 5E8795880B; Sat, 29 Jul 2006 16:02:14 -0700 (PDT) Date: Sat, 29 Jul 2006 16:02:14 -0700 From: Paul Allen To: Michal Mertl Message-ID: <20060729230214.GI12597@groat.ugcs.caltech.edu> References: <200607251254.k6PCsBef092737@lurza.secnetix.de> <200607271058.13055.jhb@freebsd.org> <20060728121525.GA44917@uk.tiscali.com> <200607280928.36573.jhb@freebsd.org> <20060728134701.GA45273@uk.tiscali.com> <20060728210154.GC748@turion.vk2pj.dyndns.org> <1154189612.1565.10.camel@genius.i.cz> <20060729205655.GE748@turion.vk2pj.dyndns.org> <20060729211530.GA50342@uk.tiscali.com> <1154212340.3609.18.camel@genius.i.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1154212340.3609.18.camel@genius.i.cz> Sender: jd@ugcs.caltech.edu Cc: Peter Jeremy , freebsd-current@freebsd.org, Brian Candler Subject: Re: vmstat's entries type 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: Sat, 29 Jul 2006 23:02:15 -0000 Surely all you need to do is a cheap crit_enter,crit_exit while updating the 64-bit per cpu counters. and on a 64-bit arch you skip the crit_enter,crit_exit. Seriously this is a bike shed. We can summarize it thus: statistics should be maintained in 64-bit counters, these counters should be per-cpu and consistent in that context, nothing else should appear on the critical path. **end of story** Paul p.s., and as a general of thumb, if a per-cpu solution doesn't explode in complexity/memory usage it should be preferred over a mutex by default.