From owner-freebsd-current@FreeBSD.ORG Sat Jul 29 20:52:26 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 F273316A4E7 for ; Sat, 29 Jul 2006 20:52:26 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from mail13.syd.optusnet.com.au (mail13.syd.optusnet.com.au [211.29.132.194]) by mx1.FreeBSD.org (Postfix) with ESMTP id A565443D46 for ; Sat, 29 Jul 2006 20:52:25 +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 mail13.syd.optusnet.com.au (8.12.11/8.12.11) with ESMTP id k6TKqM9X027053 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Sun, 30 Jul 2006 06:52:23 +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 k6TKqLeB007628; Sun, 30 Jul 2006 06:52:22 +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 k6TKqKT5007627; Sun, 30 Jul 2006 06:52:20 +1000 (EST) (envelope-from peter) Date: Sun, 30 Jul 2006 06:52:20 +1000 From: Peter Jeremy To: Sten Daniel =?iso-8859-1?Q?S=F8rsdal?= Message-ID: <20060729205220.GD748@turion.vk2pj.dyndns.org> 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> <44CBB179.6070904@wm-access.no> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="pQhZXvAqiZgbeUkD" Content-Disposition: inline In-Reply-To: <44CBB179.6070904@wm-access.no> X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.11 Cc: freebsd-current@freebsd.org 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 20:52:27 -0000 --pQhZXvAqiZgbeUkD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, 2006-Jul-29 21:05:29 +0200, Sten Daniel Srsdal wrote: >Peter Jeremy wrote: >> In a MP configuration where it doesn't particularly matter if a >> particular update gets counted this time or next time, I think the >> cheapest option is to have per-CPU 32-bit counters (so no locks are >> needed to update the counters) with a polling function to accumulate >> all the individual counters into a 64-bit total. This pushes the cost >> from the update (very frequent) into the read (which is relatively >> infrequent), for a lower overall cost. >Is caching necessary somewhere or can the function return the value >directly without storing the global accumulated counter? If you want a 64-bit final result that takes into account overflows in the 32-bit per-CPU counters, then you will need some way to keep track of the number of overflows in each counter. --=20 Peter Jeremy --pQhZXvAqiZgbeUkD Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.4 (FreeBSD) iD8DBQFEy8qE/opHv/APuIcRAvm/AJ4mwLBMec9CemgPajL0Tx+KbPB23ACdF2ym EgSFOmTnNKAPSo5ViLKjgpk= =g8X1 -----END PGP SIGNATURE----- --pQhZXvAqiZgbeUkD--