Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Mar 2024 15:47:51 -0700
From:      Mark Millard <marklmi@yahoo.com>
To:        FreeBSD Mailing List <freebsd-ports@freebsd.org>
Subject:   poudriere(-devel) status -b %mem: based on sysctl's hw.availpages and on ->ki_p->ki_rssize (resident set size) [not on RAM+SWAP use]
Message-ID:  <E3F44D20-48E8-461E-8C1F-FA6CC11A5FB1@yahoo.com>
References:  <E3F44D20-48E8-461E-8C1F-FA6CC11A5FB1.ref@yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
poudriere's documentation is not explicit about which "memory" sizes =
that
the %mem is relative to. Nor is is explicit about how it gets the =
figure.

Tracing that "how" down lead to finding use of:

ps -ax -o jail,%cpu,%mem

(poudriere totals across the processes in the same jail [same builder].)

The ps documentation is in turn not explicit about such. Tracking that
down lead to:

/usr/main-src/bin/ps/print.c: fracmem =3D ((double)k->ki_p->ki_rssize) / =
mempages;
/usr/main-src/bin/ps/extern.h:extern unsigned long mempages;
/usr/main-src/bin/ps/nlist.c:unsigned long mempages; /* number of pages =
of phys. memory */
/usr/main-src/bin/ps/nlist.c: oldlen =3D sizeof(mempages);
/usr/main-src/bin/ps/nlist.c: if (sysctlbyname("hw.availpages", =
&mempages, &oldlen, NULL, 0) =3D=3D -1)

So: poudriere status -b 's MEM% reports the (scaled) fraction:
(resident set size)/(hw.availpages)

It expects the processes in a jail to all have the same
hw.availpages value (a common denominator). It appears
to expect the same across jails in order to have
comparability across jails.

This implies that if one is trying to see relationships to
overall RAM+SWAP capacity, with a non-zero amount of SWAP
available in the context, the MEM% is inappropriate.

It would be good if the documentation indicated in some way
what to expect one can reasonably do with the MEM% figures
that "poudriere status -b" reports (vs. what one can not
reasonably do with them).

Note:
It would appear that the TMPFS figures reported are not part
of the resident set figures. So the MEM% figures look like
they exclude the TMPFS related RAM+SWAP usage figures that
are reported.

=3D=3D=3D
Mark Millard
marklmi at yahoo.com




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E3F44D20-48E8-461E-8C1F-FA6CC11A5FB1>