Red Hat Bugzilla – Bug 840747
vmstat always reports zero for 'si' and 'so' columns if your units are set to MiB (-SM)
Last modified: 2016-10-31 09:49:15 EDT
Created attachment 598570 [details]
Working vmstat.c patch against procps-3.2.8-23.el6.src.rpm
Description of problem:
The vmstat 'si' and 'so' columns are always zero if you run vmstat with -SM.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. vmstat -SM 1
2. cause swapping activity in another window
3. flip back to vmstat window, observe 'swpd' incrementing but not 'si' and 'so'.
The 'swpd' column changes, but 'si' and 'so' always remain zero.
I'd expect to see the 'si' and 'so' columns change with the 'swpd' column.
unitConvert is incorrectly being applied to kb_per_page and not *pswpin * kb_per_page. The problem is kb_per_page is a small number, maybe 4. You convert that to MiB and you're always going to get an integer zero, which causes the whole calculation to be zero. The right thing to do is convert *psppwin * kb_per_page to MiB.
I recently fixed exactly the same issue in RHEL5. My patch is almost identical to yours (I just additionally changed the unitConvert input type to long). Anyway, that confirms the solution is reasonable and should work correctly.
Thanks for reporting.
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unable to address this
request at this time.
Red Hat invites you to ask your support representative to
propose this request, if appropriate, in the next release of
Red Hat Enterprise Linux.
Already fixed in 3.2.8-24
Duplicate of https://bugzilla.redhat.com/show_bug.cgi?id=851664
*** This bug has been marked as a duplicate of bug 851664 ***