From owner-freebsd-bugs@FreeBSD.ORG Thu Jul 31 10:40:14 2003 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CC96237B405 for ; Thu, 31 Jul 2003 10:40:14 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 33A2C43FD7 for ; Thu, 31 Jul 2003 10:40:11 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h6VHeBUp094468 for ; Thu, 31 Jul 2003 10:40:11 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h6VHeBSS094467; Thu, 31 Jul 2003 10:40:11 -0700 (PDT) Resent-Date: Thu, 31 Jul 2003 10:40:11 -0700 (PDT) Resent-Message-Id: <200307311740.h6VHeBSS094467@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Bruce M Simpson Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 041DD37B401 for ; Thu, 31 Jul 2003 10:33:29 -0700 (PDT) Received: from bigboy.spc.org (bigboy.spc.org [195.206.69.225]) by mx1.FreeBSD.org (Postfix) with ESMTP id CBC3843F3F for ; Thu, 31 Jul 2003 10:33:27 -0700 (PDT) (envelope-from bms@spc.org) Received: from saboteur.dek.spc.org (unknown [81.3.72.68]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by bigboy.spc.org (Postfix) with ESMTP id 11704316A for ; Thu, 31 Jul 2003 18:34:18 +0100 (BST) Received: by saboteur.dek.spc.org (Postfix, from userid 1001) id 980BE53F; Thu, 31 Jul 2003 18:33:15 +0100 (BST) Message-Id: <20030731173315.980BE53F@saboteur.dek.spc.org> Date: Thu, 31 Jul 2003 18:33:15 +0100 (BST) From: Bruce M Simpson To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/55124: [PATCH] request total incorrectly reported by vmstat(8) X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Bruce M Simpson List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jul 2003 17:40:15 -0000 >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@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: