From owner-freebsd-bugs Mon Mar 5 8:40:11 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id DA1D637B71A for ; Mon, 5 Mar 2001 08:40:01 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f25Ge1Z33519; Mon, 5 Mar 2001 08:40:01 -0800 (PST) (envelope-from gnats) Received: from mgate08.so-net.ne.jp (mgate08.so-net.ne.jp [210.139.254.155]) by hub.freebsd.org (Postfix) with ESMTP id 0EAF037B719 for ; Mon, 5 Mar 2001 08:36:49 -0800 (PST) (envelope-from ipfw@ya3.so-net.ne.jp) Received: from mail.ya3.so-net.ne.jp (mspool11.so-net.ne.jp [210.139.248.11]) by mgate08.so-net.ne.jp (8.8.8+3.0Wbeta9/3.6W01022711) with ESMTP id BAA08749 for ; Tue, 6 Mar 2001 01:36:47 +0900 (JST) Received: from localhost (pee7b3c.kngwnt01.ap.so-net.ne.jp [202.238.123.60]) by mail.ya3.so-net.ne.jp (8.9.3/3.7W01022316) with ESMTP id BAA17102 for ; Tue, 6 Mar 2001 01:36:46 +0900 (JST) Message-Id: <20010306014248K.ipfw@ya3.so-net.ne.jp> Date: Tue, 06 Mar 2001 01:42:48 +0900 From: Yoshihiro Koya To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.113 Subject: bin/25545: Incorrect output of top(1) Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 25545 >Category: bin >Synopsis: Incorrect Mem value produced by top(1). >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Mar 05 08:40:01 PST 2001 >Closed-Date: >Last-Modified: >Originator: Yoshihiro Koya >Release: FreeBSD 5.0-CURRENT i386 >Organization: Dpet. of Math. Sci, Yokohama City University >Environment: System: FreeBSD current.my.domain 5.0-CURRENT FreeBSD 5.0-CURRENT #2: Mon Mar 5 20:08:25 JST 2001 root@current.my.domain:/usr/obj/usr/src/sys/current i386 >Description: The value produced by top(1) is incorrect. For example, last pid: 734; load averages: 0.13, 0.04, 0.02 up 0+00:26:37 01:32:02 33 processes: 1 running, 32 sleeping CPU states: % user, % nice, % system, % interrupt, % idle Mem: 9044K Active, 8241K Inact, 5703K Wired, 15K Cache, 35M Buf, 40M Free Swap: 256M Total, 256M Free The output above was obtained on the machine with 256MB ram. The sum of value "Active", "Inact", "Wired", "Chache", "Buf" and "Free" seems to be too small. >How-To-Repeat: % top and investigate its output. >Fix: --- machine.c.orig Tue Mar 6 01:23:21 2001 +++ machine.c Tue Mar 6 01:31:37 2001 @@ -330,7 +330,12 @@ GETSYSCTL("vm.stats.vm.v_swappgsin", nspgsin); GETSYSCTL("vm.stats.vm.v_swappgsout", nspgsout); /* convert memory stats to Kbytes */ + memory_stats[0] = pagetok(memory_stats[0]); + memory_stats[1] = pagetok(memory_stats[1]); + memory_stats[2] = pagetok(memory_stats[2]); + memory_stats[3] = pagetok(memory_stats[3]); memory_stats[4] = bufspace / 1024; + memory_stats[5] = pagetok(memory_stats[5]); memory_stats[6] = -1; /* first interval */ >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message