From owner-freebsd-current@FreeBSD.ORG Fri Sep 30 18:57:13 2005 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1458A16A41F; Fri, 30 Sep 2005 18:57:13 +0000 (GMT) (envelope-from mi+mx@aldan.algebra.com) Received: from blue.virtual-estates.net (aldan.algebra.com [216.254.65.224]) by mx1.FreeBSD.org (Postfix) with ESMTP id 51D0E43D48; Fri, 30 Sep 2005 18:57:12 +0000 (GMT) (envelope-from mi+mx@aldan.algebra.com) Received: from corbulon.video-collage.com (static-151-204-231-237.bos.east.verizon.net [151.204.231.237]) by blue.virtual-estates.net (8.13.4/8.13.4) with ESMTP id j8UIvA4t009000 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 30 Sep 2005 14:57:11 -0400 (EDT) (envelope-from mi+mx@aldan.algebra.com) Received: from mteterin.us.murex.com (195-11.customer.cloud9.net [168.100.195.11]) by corbulon.video-collage.com (8.13.4/8.13.1) with ESMTP id j8UIv4sl015061 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 30 Sep 2005 14:57:05 -0400 (EDT) (envelope-from mi+mx@aldan.algebra.com) Received: from mteterin.us.murex.com (mteterin@localhost [127.0.0.1]) by mteterin.us.murex.com (8.13.3/8.13.3) with ESMTP id j8UIuxm5003642; Fri, 30 Sep 2005 14:56:59 -0400 (EDT) (envelope-from mi+mx@aldan.algebra.com) Received: from localhost (localhost [[UNIX: localhost]]) by mteterin.us.murex.com (8.13.3/8.13.3/Submit) id j8UIuuL8003641; Fri, 30 Sep 2005 14:56:56 -0400 (EDT) (envelope-from mi+mx@aldan.algebra.com) X-Authentication-Warning: mteterin.us.murex.com: mteterin set sender to mi+mx@aldan.algebra.com using -f From: Mikhail Teterin Organization: Virtual Estates, Inc. To: current@freebsd.org Date: Fri, 30 Sep 2005 14:56:56 -0400 User-Agent: KMail/1.8.2 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200509301456.56638.mi+mx@aldan.algebra.com> X-Virus-Scanned: ClamAV devel-20050525/1105/Thu Sep 29 17:31:04 2005 on corbulon.video-collage.com X-Virus-Status: Clean X-Scanned-By: MIMEDefang 2.43 X-Mailman-Approved-At: Sat, 01 Oct 2005 11:40:41 +0000 Cc: ps@freebsd.org, imp@freebsd.org Subject: strange values in `systat -vm' X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Sep 2005 18:57:13 -0000 On one of my computers the ``Dir-cache'' column of the systat's vm-display is always either empty or displays something like: Dir-cache hits % X X00 When X happens to be too big, the X00 gets replaced by "****". Looking into the usr.bin/systat/vmstat.c, I find, that the numbers are coming from nchtotal.ncs_pass2, which is expected to be less than s.nchcount. I put some debugging instrumentation around that code, and see that that second number (nchcount), however, is always zero and so nz() turns it into 1, which leads to the multiplication by 100 I observe. The nchcount is computed as: nchtotal.ncs_goodhits + nchtotal.ncs_badhits + nchtotal.ncs_miss + nchtotal.ncs_long + nchtotal.ncs_neghits; which does not, indeed, include the ncs_pass2. Should it? How does it work for others (including my other machines)? The numbers are obtained via sysctl("vfs.cache.nchstats") and I don't know, what exactly they mean :-) A one-per-second call to sysctl from command line returns: vfs.cache.nchstats: 2546 138 16 0 297 0 1753939 3111941 vfs.cache.nchstats: 2546 138 16 0 297 0 1753943 3111992 vfs.cache.nchstats: 2546 138 16 0 297 0 1753947 3112167 vfs.cache.nchstats: 2546 138 16 0 297 0 1753951 3112237 vfs.cache.nchstats: 2546 138 16 0 297 0 1753955 3112277 [...] I saw this in 5.x and am still seeing it in 6.0B5. -mi