From owner-cvs-all Sun Dec 22 17:44:28 2002 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BC2BF37B401; Sun, 22 Dec 2002 17:44:26 -0800 (PST) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1D38743EDA; Sun, 22 Dec 2002 17:44:25 -0800 (PST) (envelope-from bde@zeta.org.au) Received: from katana.zip.com.au (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id MAA19290; Mon, 23 Dec 2002 12:44:21 +1100 Date: Mon, 23 Dec 2002 12:46:14 +1100 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Matt Dillon Cc: cvs-committers@FreeBSD.org, Subject: Re: cvs commit: src/sys/vm vm_meter.c In-Reply-To: <200212220504.gBM54UO7006013@repoman.freebsd.org> Message-ID: <20021223123800.U11555-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sat, 21 Dec 2002, Matt Dillon wrote: > dillon 2002/12/21 21:04:30 PST > > Modified files: > sys/vm vm_meter.c > Log: > The UP -current was not properly counting the per-cpu VM stats in the > sysctl code. This makes 'systat -vm 1's syscall count work again. > > Submitted by: Michal Mertl > Note: also slated for 5.0 > > Revision Changes Path > 1.67 +3 -0 src/sys/vm/vm_meter.c I have used the following fix for this for 6 months or so and sent it to some SMP person(s). It is better because it has no space or time costs instead of tiny ones, and it actually works (in the !SMP case) for programs that read the variable directly from kmem or panic dumps. Fixing the SMP case for these programs is not so easy. There is at least one PR about this bug. %%% Index: pcpu.h =================================================================== RCS file: /home/ncvs/src/sys/sys/pcpu.h,v retrieving revision 1.10 diff -u -2 -r1.10 pcpu.h --- pcpu.h 10 Dec 2002 02:33:45 -0000 1.10 +++ pcpu.h 10 Dec 2002 06:04:52 -0000 @@ -99,6 +101,10 @@ * support single-instruction memory increments. */ -#define PCPU_LAZY_INC(var) (++*PCPU_PTR(var)) - +#ifdef SMP +#define PCPU_LAZY_INC(var) (++*PCPU_PTR(var)) +#else +#define PCPU_LAZY_INC(var) (++(var)) +#endif + /* * Machine dependent callouts. cpu_pcpu_init() is responsible for %%% Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message