vmstat reporting incorrect cpu usage

Neo-Vortex root at Neo-Vortex.net
Sat Jun 4 14:02:02 GMT 2005


I've noticed if i run vmstat with no params when rebuilding the kernel i
get this right:

# vmstat
 procs      memory      page                   disk   faults      cpu
 r b w     avm    fre  flt  re  pi  po  fr  sr ad0   in   sy  cs us sy id
 2 1 0  294156  44596  313   0   0   0 296   1   0   82   85 225 14  8 78
#

But, if i run it like this

# vmstat -c 2
 procs      memory      page                   disk   faults      cpu
 r b w     avm    fre  flt  re  pi  po  fr  sr ad0   in   sy  cs us sy id
 1 1 0  299580  38204  313   0   0   0 296   1   0   82   85 225 14  8 78
 1 1 0  294996  42876  886   0   0   0 2061   0   3 2222 1364 2231 81 19 0
#

The second result shows what top does, but the first one seems to be
completely wrong...

# vmstat -c 6
 procs      memory      page                   disk   faults      cpu
 r b w     avm    fre  flt  re  pi  po  fr  sr ad0   in   sy  cs us sy id
 1 1 0  300136  36196  313   0   0   0 296   1   0   82   85 225 14  8 78
 1 1 0  301040  35312  230   0   0   0   9   0   0 2193  489 2156 87 13  0
 1 1 0  296720  39644 1234   0   0   0 2326   0   5 2190 1530 2185 70 30 0
 1 1 0  297092  39228 1435   0   0   0 1336   0   3 2200 1562 2188 75 25 0
 1 1 0  298488  37844 1573   0   0   0 1229   0   4 2206 1592 2191 69 31 0
 1 1 0  299372  36908  316   0   0   0 123   0  96 2301  618 2442 86 14  0
#

Only the first one seems to do it though...

FreeBSD 5.3-RELEASE.

Does this happen for anyone else? (Mabe someone running 5.4 can test
this?)

~Neo-Vortex



More information about the freebsd-hackers mailing list