vmstat's w column
Michael W. Lucas
mwlucas at michaelwlucas.com
Wed Oct 4 10:00:02 UTC 2017
On Wed, Oct 04, 2017 at 09:12:26AM +0300, Konstantin Belousov wrote:
> On Tue, Oct 03, 2017 at 02:57:28PM -0700, Don Lewis wrote:
> > On 3 Oct, Michael W. Lucas wrote:
> > > Hi,
> > >
> > > (This query brought to you courtesy of tech reviews on my new freeBSD
> > > book.)
> > >
> > > On my -current box, vmstat(8) says:
> > >
> > > procs Information about the numbers of processes in various states.
> > >
> > > r in run queue
> > > b blocked for resources (i/o, paging, etc.)
> > > w runnable or short sleeper (< 20 secs) but swapped
> > >
> > > I've had a couple people report to me that they have w entries even
> > > when only a few kilobytes are swapped out.
> > >
> > > Is the man page wrong? Or should I tell them to report that output as
> > > a bug?
> >
> > I don't know about the runnable or short sleeper bit. On currently idle
> > package build box vmstat currently reports 15 processes in the w column.
> > If I look at the output of ps, there are 15 processes with a state of
> > either IW or TW, all of which have a RSS of zero. These have probably
> > all been idle since before the end of the last poudriere run, which is a
> > very heavy swap user. There are no processes in an RW or SW state. It
> > looks like vmstat is reporting all swapped processes, so the man page
> > and implementation appear to be out of sync, at least on recent
> > 12.0-CURRENT. My other two currently running FreeBSD boxes don't have
> > any swapped processes reported by either ps or vmstat.
>
> Present definition of 'swapped out' is a process for which all threads
> have their kernel stacks swapped out. Swapper does not perform any
> efforts to swap out userspace memory of the process. The reasoning is
> perhaps that normal pagedaemon processing would inactivate/page out
> the unreferenced pages on busy system, and swapping the kernel stacks
> never occurs if pagedaemon can keep with the memory demand without such
> drastic measures.
>
> In other words, RSS == 0 is neither necessary nor sufficient to conclude
> that a process is swapped out.
Thanks, folks. I'll be adding bits of this conversation to the
swapping discussion.
And I'm hearing, from an end users' point of view:
The w column no longer provides useful performance information.
==ml
--
Michael W. Lucas https://mwl.io/
nonfiction: https://www.michaelwlucas.com/
fiction: https://www.michaelwarrenlucas.com/
More information about the freebsd-hackers
mailing list