bin/55124: [PATCH] request total incorrectly reported by vmstat(8)

Bruce M Simpson bms at spc.org
Thu Jul 31 10:40:15 PDT 2003


>Number:         55124
>Category:       bin
>Synopsis:       [PATCH] request total incorrectly reported by vmstat(8)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jul 31 10:40:10 PDT 2003
>Closed-Date:
>Last-Modified:
>Originator:     Bruce M Simpson
>Release:        FreeBSD 4.8-RELEASE i386
>Organization:
>Environment:
System: FreeBSD arginine.spc.org 4.8-RELEASE FreeBSD 4.8-RELEASE #0: Tue Jul  8 15:15:51 BST 2003     root at arginine.spc.org:/usr/src/sys/compile/ARGININE  i386

	
>Description:
	Under RELENG_4, the running total of requests for each subsystem
	client of the vm (vmstat -m) is incorrectly reported due to the use
	of a signed (vs unsigned) integer.
	
>How-To-Repeat:
	
>Fix:

	Please apply the patch below to correct the problem,
	in /usr/src/usr.bin/vmstat.

--- vmstat_totreq.patch begins here ---
--- vmstat.c.orig	Thu Jul 31 18:26:36 2003
+++ vmstat.c	Thu Jul 31 18:27:00 2003
@@ -758,7 +758,8 @@
 	register struct malloc_type *ks;
 	register int i, j;
 	int len, size, first, nkms;
-	long totuse = 0, totfree = 0, totreq = 0;
+	long totuse = 0, totfree = 0;
+	unsigned long totreq = 0;
 	const char *name;
 	struct malloc_type kmemstats[MAX_KMSTATS], *kmsp;
 	char buf[1024];
@@ -862,7 +863,7 @@
 		totreq += ks->ks_calls;
 	}
 	(void)printf("\nMemory Totals:  In Use    Free    Requests\n");
-	(void)printf("              %7ldK %6ldK    %8ld\n",
+	(void)printf("              %7ldK %6ldK    %8lu\n",
 	     (totuse + 1023) / 1024, (totfree + 1023) / 1024, totreq);
 }
 
--- vmstat_totreq.patch ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list