The out-of-swap killer makes poor choices

tech-lists tech-lists at zyxst.net
Mon Mar 1 15:57:19 UTC 2021


Hi,

On Tue, Feb 23, 2021 at 01:49:49PM -0700, Alan Somers wrote:

[...lots...]

I've found that if I take a system already configured with swap, then
add say 2* 16GB swapfiles as per the handbook, enable the swapfiles,
that some things will use the swapfile and others not, even with plenty
available in the swapfiles.

example: 12-stable amd64 system running poudriere.

it will use the swap configured by default (think it's 2GB) as a
partition. In this example, all of swap is on ssd - the partition and
both swapfiles. Compiling some things like rust or firefox will use all
of the partition swap and some of the *swapfile* but not all of it[1]. It's
almost like some processes have more of an affinity for swap as a
partition than others, and others won't use swap as a swapfile at all.

In the end, because I don't know how to debug this kind of issue
further, it was easier to blat the ssd and install 32GB of swap on
reinstallation of the OS. Swapfiles arent used now, on this particular
install. The 32GB swap partition is fine and works as expected.

Thought the above might be of use as I dunno, a data point. I wonder,
though, why some programs have seemingly more affinity for swap-as-partition 
than swap-as-swapfile.

[1] by "not all of it" I mean fail with an OOM message before all of the
swapfile is used
-- 
J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20210301/170ecdaf/attachment.sig>


More information about the freebsd-hackers mailing list