Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Apr 2018 19:03:43 -0700
From:      Mark Millard <marklmi26-fbsd@yahoo.com>
To:        Andriy Gapon <avg@FreeBSD.org>
Cc:        freebsd-current@freebsd.org
Subject:   Re: Strange ARC/Swap/CPU on yesterday's -CURRENT
Message-ID:  <D74DE9BB-49F1-414A-B213-4691CD194CE6@yahoo.com>
In-Reply-To: <1b31e36e-e84b-cc63-1422-d1e0ce2f03c8@FreeBSD.org>
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>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2018-Apr-4, at 10:16 AM, Andriy Gapon <avg at FreeBSD.org> wrote:

> On 01/04/2018 05:31, Mark Millard wrote:
>> I have a hypothesis for part of what top is
>> counting in the process/thread SWAP column
>> that might not be what one would expect.
>>=20
>> It appears to me that vnode-backed pages are
>> being re-classfied sometimes for inactive
>> processes, and this classification leads to
>> top classifying the pages as not-resident
>> but swapped (in that a "VN PAGER in" would
>> be required, in systat -vmstat terms).
>=20
> Not sure.
> To me it seems that top just uses wrong statistics to calculate the =
value.
>=20
> /* swap usage */
> #define ki_swap(kip) \
>   ((kip)->ki_swrss > (kip)->ki_rssize ? (kip)->ki_swrss - =
(kip)->ki_rssize : 0)
>=20
> ki_rssize is the resident size of a process.
> ki_swrss is resident set size before last swap.
>=20
> Their difference is... exactly what?
> I cannot even meaningfully describe this value.
> But it is certainly _not_ the current swap utilization by the process.
>=20
> Here is my attempt at obtaining a more reasonable approximation of =
the. process
> swap use.  But it is still wildly inaccurate.
>=20
> . . .

If I get time this weekend, I'll try the patch. Thanks.

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?

=3D=3D=3D
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?D74DE9BB-49F1-414A-B213-4691CD194CE6>