From owner-freebsd-stable@FreeBSD.ORG Sun Jul 6 19:54:07 2003 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 87D0237B404 for ; Sun, 6 Jul 2003 19:54:07 -0700 (PDT) Received: from pd6mo3so.prod.shaw.ca (shawidc-mo1.cg.shawcable.net [24.71.223.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2AE0943F85 for ; Sun, 6 Jul 2003 19:54:06 -0700 (PDT) (envelope-from cpressey@catseye.mb.ca) Received: from pd4mr1so.prod.shaw.ca (pd4mr1so-qfe3.prod.shaw.ca [10.0.141.212]) by l-daemon (iPlanet Messaging Server 5.2 HotFix 1.16 (built May 14 2003)) with ESMTP id <0HHM00D8LW25WQ@l-daemon> for freebsd-stable@freebsd.org; Sun, 06 Jul 2003 20:54:05 -0600 (MDT) Received: from pn2ml10so.prod.shaw.ca (pn2ml10so-qfe0.prod.shaw.ca [10.0.121.80]) by l-daemon (iPlanet Messaging Server 5.2 HotFix 1.16 (built May 14 2003)) with ESMTP id <0HHM0054DW25TG@l-daemon> for freebsd-stable@freebsd.org; Sun, 06 Jul 2003 20:54:05 -0600 (MDT) Received: from kallisti.ca (h24-70-180-74.wp.shawcable.net [24.70.180.74]) by l-daemon (iPlanet Messaging Server 5.2 HotFix 1.16 (built May 14 2003)) with SMTP id <0HHM00FL8W24WB@l-daemon> for freebsd-stable@freebsd.org; Sun, 06 Jul 2003 20:54:05 -0600 (MDT) Date: Sun, 06 Jul 2003 21:55:45 -0500 From: Chris Pressey In-reply-to: <20030706213540.GU430@gsmx07.alcatel.com.au> To: Peter Jeremy Message-id: <20030706215545.1c29c5ed.cpressey@catseye.mb.ca> Organization: Cat's Eye Technologies - http://www.catseye.mb.ca/ MIME-version: 1.0 X-Mailer: Sylpheed version 0.9.3 (GTK+ 1.2.10; i386-portbld-freebsd4.8) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT References: <200307051728.24681.me@farid-hajji.de> <44brw8g26e.fsf@be-well.ilk.org> <200307060029.00866.me@farid-hajji.de> <3F07576F.4030105@mac.com> <20030706213540.GU430@gsmx07.alcatel.com.au> cc: freebsd-stable@freebsd.org Subject: Re: Weird vmstat -s stats X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jul 2003 02:54:07 -0000 On Mon, 7 Jul 2003 07:35:40 +1000 Peter Jeremy wrote: > On 2003-Jul-05 18:55:43 -0400, Chuck Swiger wrote: > >Farid Hajji wrote: > >[ ... ] > >>Shouldn't such counters be at least 64 bit wide? > > > >You betcha. :-) The problem is that a 32-bit CPU, like the Intel > >x86 family, can't increment a 64-bit counter atomicly. > > This isn't absolutely true. You _can_ perform atomic 64-bit > operations on an x86 (for x>=5), they are just extremely expensive. > > There are regular threads on this sort of problem and I don't believe > anyone has come up with a solution that did not involve overheads that > were considered unacceptable in the general case. > > Peter 'Scuse me if I'm out of my depth here, but wouldn't the atomic 64-bit update only have to be done when the lower 32 bits were about to wrap (which would be relatively infrequent)? The check to see if the lower 32 bits were about to wrap would be relatively cheap, too, I'd think. That's just an idle guess, though. -Chris