Date: Wed, 4 Oct 2017 09:12:26 +0300 From: Konstantin Belousov <kostikbel@gmail.com> To: Don Lewis <truckman@FreeBSD.org> Cc: mwlucas@michaelwlucas.com, hackers@freebsd.org Subject: Re: vmstat's w column Message-ID: <20171004061226.GA95911@kib.kiev.ua> In-Reply-To: <201710032157.v93LvSjD040775@gw.catspoiler.org> References: <20171003202150.GA42540@mail.michaelwlucas.com> <201710032157.v93LvSjD040775@gw.catspoiler.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20171004061226.GA95911>