strange values in `systat -vm'

From: Mikhail Teterin <mi+mx_at_aldan.algebra.com>
Date: Fri, 30 Sep 2005 14:56:56 -0400
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
Received on Fri Sep 30 2005 - 16:57:13 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:44 UTC