Re: An idea for swap partition size vs. swap space size in use handling

From: Jamie Landeg-Jones <jamie_at_catflap.org>
Date: Sun, 26 Feb 2023 04:01:56 UTC
Mark Millard <marklmi@yahoo.com> wrote:

> On Jan 21, 2023, at 23:17, Poul-Henning Kamp <phk@phk.freebsd.dk> wrote:
> > 
> > Last I looked at that code, that is precisely what happens
> > if you add a too big swap-device ?
>
> It produces a notice reporting how much bigger what it is
> using is than what is recommended, if I understand the
> message right. Here is an example were the difference was
> small for an armv7 context:
>
> warning: total configured swap (1003519 pages) exceeds maximum recommended amount (1003072 pages).
>
> Another from a context with a much bigger difference:
>
> warning: total configured swap (2097152 pages) exceeds maximum recommended amount (916632 pages).
>
> These sort of messages are followed by:
>
> warning: increase kern.maxswzone or reduce amount of swap.

I thought the same as phk. And I always thought those messages were
just informational warnings on what to do to stop that excess swap
space being unused and effectively wasted (i.e. suggestions to change
settings, or reduce the swap size!), but you say this isn't correct:

> As I understand, the 2097152 pages vs. 916632 pages example means
> that it was operating with the referenced fragmentation problems
> being more likely. That would not be true if it was just using
> more like the 916632 pages and ignoring the rest.

Are you, phk, or anyone else, able to provide further pointers or
clarification on this?

Cheers, Jamie