Date: Fri, 30 Sep 2005 14:56:56 -0400 From: Mikhail Teterin <mi+mx@aldan.algebra.com> To: current@freebsd.org Cc: ps@freebsd.org, imp@freebsd.org Subject: strange values in `systat -vm' Message-ID: <200509301456.56638.mi%2Bmx@aldan.algebra.com>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200509301456.56638.mi%2Bmx>
