Date: Thu, 5 Apr 2018 12:03:21 +0300 From: Andriy Gapon <avg@FreeBSD.org> To: Mark Millard <marklmi26-fbsd@yahoo.com> Cc: freebsd-current@freebsd.org Subject: Re: Strange ARC/Swap/CPU on yesterday's -CURRENT Message-ID: <14a14c1a-129c-0733-34c8-8eefae3fd084@FreeBSD.org> In-Reply-To: <D74DE9BB-49F1-414A-B213-4691CD194CE6@yahoo.com> References: <FD75495D-AC03-4037-9C62-5A3AC588317C@yahoo.com> <alpine.BSF.2.21.1803111759150.1232@desktop> <20180317103915.081ca2dd@thor.intern.walstatt.dynvpn.de> <F48580A7-2C4C-4297-B083-B7EEBA1C8665@yahoo.com> <f48d7287-c707-369d-f2cb-6bf0ed1054c6@FreeBSD.org> <D9288EC1-624E-4977-BD97-557DA11A5D8E@yahoo.com> <a1d97a3c-247f-8eb0-6497-d0273773741c@FreeBSD.org> <E41D1122-9E08-41C7-B970-AC085CC5829D@yahoo.com> <1b31e36e-e84b-cc63-1422-d1e0ce2f03c8@FreeBSD.org> <D74DE9BB-49F1-414A-B213-4691CD194CE6@yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 05/04/2018 05:03, Mark Millard wrote: > I've classically seen things like (picking on java here): > (no patch yet, so SWAP 0K shows) > > PID USERNAME THR PRI NICE SIZE RES SWAP STATE C TIME CPU COMMAND > 78694 root 44 52 0 14779M 92720K 0K uwait 22 0:06 9.91% [java] > > when Swap: . . . 0 Used . . . (or some figure much > smaller than SIZE-RES) showed. (SIZE is ki_size and > RES is ki_rssize as I remember.) It suggests some > form of reserved-but-not-allocated contribution to > ki_size (SIZE), space not resident nor swapped out > to a swap partition. Possibly vnode-backed (potential > "VN PAGER in and out" contributions instead of "SWAP > PAGER" ones, in systat -vmstat terms)? > > Are such cases examples of what you were counting > as "wildly inaccurate"? Or do you count vnode-backed > but not resident as perfectly good examples of SWAP > in use? Apologies, but I didn't quite get your question... Instead, I think I now understand better what top actually reports. I think that it reports swap usage based on the archaic swapout algorithm where a whole process is moved to swap when a memory shortage arises. And then the process can be gradually swapped in. So, ki_swrss - ki_rssize is an estimate of how much process's memory still left in swap (the difference between the resident size before the full swapout and the current resident size). Of course, now we have the modern swapout where individual inactive dirty anonymous pages can be paged out to swap (the classic whole-process swapout still can happen, but is quite rare), but top is not aware of that. -- Andriy Gapon
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?14a14c1a-129c-0733-34c8-8eefae3fd084>