NetBSD Problem Report #29213

From njoly@pasteur.fr  Thu Feb  3 13:22:02 2005
Return-Path: <njoly@pasteur.fr>
Received: from electre.pasteur.fr (electre.pasteur.fr [157.99.64.120])
	by narn.netbsd.org (Postfix) with ESMTP id D83A563B400
	for <gnats-bugs@gnats.NetBSD.org>; Thu,  3 Feb 2005 13:22:01 +0000 (UTC)
Message-Id: <20050203132157.D33736B431@lanfeust.sis.pasteur.fr>
Date: Thu,  3 Feb 2005 14:21:57 +0100 (CET)
From: njoly@pasteur.fr
Reply-To: njoly@pasteur.fr
To: gnats-bugs@netbsd.org
Subject: sysstat(1) vmstat cannot display large memory values
X-Send-Pr-Version: 3.95

>Number:         29213
>Category:       bin
>Synopsis:       sysstat(1) vmstat cannot display large memory values
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Feb 03 13:23:00 +0000 2005
>Closed-Date:    Thu Feb 03 16:16:41 +0000 2005
>Last-Modified:  Thu Feb 03 16:17:01 +0000 2005
>Originator:     Nicolas Joly
>Release:        NetBSD 2.99.15
>Organization:
Institut Pasteur, Paris.
>Environment:
System: NetBSD lanfeust.sis.pasteur.fr 2.99.15 NetBSD 2.99.15 (LANFEUST) #0: Tue Jan 25 18:26:25 CET 2005 njoly@lanfeust.sis.pasteur.fr:/local/src/NetBSD/obj/amd64/sys/arch/amd64/compile/LANFEUST amd64
Architecture: x86_64
Machine: amd64
>Description:
On systems with memory + swap exceed 10GB, `sysstat vmstat' command is not
able to display correctly some memory values. The memory columns are currently
limited to 7 chars :

          memory totals (in kB)             3570 Interrupts               fksvm
         real   virtual    free              100 cpu0 softclock           pwait
Active  31652     31652 6962188                6 cpu0 softnet             relck
All    596140    596140 *******              100 cpu0 timer               rlkok

Bumping columns to 9 characters (8 numbers + 1 separator for easier reading)
gives a better result :

            memory totals (in kB)           4619 Interrupts               fksvm
           real  virtual     free            100 cpu0 softclock           pwait
Active    31652     3165  6962188                cpu0 softnet             relck
All      596140    59614 15351516            100 cpu0 timer               rlkok

>How-To-Repeat:
run `sysstat vmstat' on system with total mem+swap >10GB
>Fix:
Index: vmstat.c
===================================================================
RCS file: /cvsroot/src/usr.bin/systat/vmstat.c,v
retrieving revision 1.56
diff -u -r1.56 vmstat.c
--- vmstat.c	13 Jun 2004 08:56:21 -0000	1.56
+++ vmstat.c	3 Feb 2005 12:49:54 -0000
@@ -324,8 +324,8 @@

 	clear();
 	mvprintw(STATROW, STATCOL + 4, "users    Load");
-	mvprintw(MEMROW, MEMCOL,     "          memory totals (in kB)");
-	mvprintw(MEMROW + 1, MEMCOL, "         real   virtual    free");
+	mvprintw(MEMROW, MEMCOL,     "            memory totals (in kB)");
+	mvprintw(MEMROW + 1, MEMCOL, "           real  virtual     free");
 	mvprintw(MEMROW + 2, MEMCOL, "Active");
 	mvprintw(MEMROW + 3, MEMCOL, "All");

@@ -501,15 +501,15 @@
 	mvaddstr(STATROW, STATCOL + 53, buf);
 #define pgtokb(pg)	((pg) * (s.uvmexp.pagesize / 1024))

-	putint(pgtokb(s.uvmexp.active), MEMROW + 2, MEMCOL + 6, 7);
+	putint(pgtokb(s.uvmexp.active), MEMROW + 2, MEMCOL + 6, 9);
 	putint(pgtokb(s.uvmexp.active + s.uvmexp.swpginuse),	/* XXX */
-	    MEMROW + 2, MEMCOL + 16, 7);
-	putint(pgtokb(s.uvmexp.npages - s.uvmexp.free), MEMROW + 3, MEMCOL + 6, 7);
+	    MEMROW + 2, MEMCOL + 16, 9);
+	putint(pgtokb(s.uvmexp.npages - s.uvmexp.free), MEMROW + 3, MEMCOL + 6, 9);
 	putint(pgtokb(s.uvmexp.npages - s.uvmexp.free + s.uvmexp.swpginuse),
-	    MEMROW + 3, MEMCOL + 16, 7);
-	putint(pgtokb(s.uvmexp.free), MEMROW + 2, MEMCOL + 24, 7);
+	    MEMROW + 3, MEMCOL + 16, 9);
+	putint(pgtokb(s.uvmexp.free), MEMROW + 2, MEMCOL + 24, 9);
 	putint(pgtokb(s.uvmexp.free + s.uvmexp.swpages - s.uvmexp.swpginuse),
-	    MEMROW + 3, MEMCOL + 24, 7);
+	    MEMROW + 3, MEMCOL + 24, 9);
 	putint(total.t_rq - 1, PROCSROW + 1, PROCSCOL + 3, 3);
 	putint(total.t_dw, PROCSROW + 1, PROCSCOL + 6, 3);
 	putint(total.t_sl, PROCSROW + 1, PROCSCOL + 9, 3);

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->closed
State-Changed-By: christos@netbsd.org
State-Changed-When: Thu, 03 Feb 2005 11:16:41 -0500
State-Changed-Why:
fixed, thanks


From: Christos Zoulas <christos@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: PR/29213 CVS commit: src/usr.bin/systat
Date: Thu,  3 Feb 2005 16:16:00 +0000 (UTC)

 Module Name:	src
 Committed By:	christos
 Date:		Thu Feb  3 16:16:00 UTC 2005

 Modified Files:
 	src/usr.bin/systat: vmstat.c

 Log Message:
 PR/29213: Nicolas Joly: sysstat(1) vmstat cannot display large memory values


 To generate a diff of this commit:
 cvs rdiff -r1.56 -r1.57 src/usr.bin/systat/vmstat.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.