Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 5 Jun 2005 00:01:58 +1000 (EST)
From:      Neo-Vortex <root@Neo-Vortex.net>
To:        freebsd-hackers@freebsd.org
Subject:   vmstat reporting incorrect cpu usage
Message-ID:  <20050604235846.X62115@Neo-Vortex.net>

next in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050604235846.X62115>