The mysterious kern.maxswzone

RW rwmaillists at
Mon Jan 21 16:03:11 UTC 2019

On Mon, 21 Jan 2019 08:56:05 +0100
Andrea Venturoli wrote:

> On 1/16/19 3:20 AM, Victor Sudakov wrote:

> > 
> > warning: total configured swap (131072 pages) exceeds maximum
> > recommended amount (113792 pages). warning: increase kern.maxswzone
> > or reduce amount of swap.  
> Many of my systems show this warning: in general it's harmless and
> you can ignore it.

Do you know, for sure, that there isn't a risk of a panic if you run out
of zone space before you run out of swap.

> > # sysctl kern.maxswzone
> > kern.maxswzone: 36175872  
> This is strange: on all my boxes (all 11.2/amd64) kern.maxswzone=0.
> If you did not set this manually (where, I don't know), perhaps this
> is an i386 vs amd64 thing.

That rings a bell. In i386 kern.maxswzone defaults to that fixed
value of 36175872. In other architectures it defaults to zero, which
means use a computed amount based on RAM size. In amd64 you can't
increase the zone size because that computed default is also the limit.
In this case, with i386, 36175872 is below the limit, so you can
increase it. 

The value is in bytes, so it isn't huge. Try setting it to a few percent

  36175872 * 131072 / 113792

something like 42500000

It should be set in loader.conf, not via sysctl.

More information about the freebsd-questions mailing list