Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Dec 2002 12:46:14 +1100 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Matt Dillon <dillon@FreeBSD.org>
Cc:        cvs-committers@FreeBSD.org, <cvs-all@FreeBSD.org>
Subject:   Re: cvs commit: src/sys/vm vm_meter.c
Message-ID:  <20021223123800.U11555-100000@gamplex.bde.org>
In-Reply-To: <200212220504.gBM54UO7006013@repoman.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <mime@traveller.cz>
>   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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021223123800.U11555-100000>