Page MenuHomeFreeBSD

swap_pager: Improve swzone warning
Needs ReviewPublic

Authored by des on Tue, Nov 11, 3:31 PM.
Tags
None
Referenced Files
F135684891: D53688.id166251.diff
Tue, Nov 11, 9:22 PM
F135684457: D53688.id.diff
Tue, Nov 11, 9:17 PM
F135679885: D53688.id166238.diff
Tue, Nov 11, 8:22 PM
F135678562: D53688.diff
Tue, Nov 11, 8:06 PM
F135678259: D53688.diff
Tue, Nov 11, 8:03 PM
F135663883: D53688.diff
Tue, Nov 11, 5:25 PM

Details

Reviewers
kib
Summary

Currently, we emit a warning if more swap is configured than half the
maximum amount we can manage (to account for fragmentation). Change the
code to emit a warning if we exceed the actual maximum, and a different,
softer warning it we exceed the recommended value.

MFC after: 1 week

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 68548
Build 65431: arc lint + arc unit

Event Timeline

des requested review of this revision.Tue, Nov 11, 3:31 PM
des retitled this revision from swap_pager: Improve maxswzone ergonomy to swap_pager: Improve swzone warning.Tue, Nov 11, 5:22 PM
des edited the summary of this revision. (Show Details)

man 8 loader_simp reports:

kern.maxswzone
              . . .

              Note that swap metadata can be fragmented, which means that
              the system can run out of space before it reaches the
              theoretical limit.  Therefore, care should be taken to not
              configure more swap than approximately half of the
              theoretical maximum.

              . . .

I dropped the part of the patch that sets maxswzone if it is zero because we already have vm.swzone which shows the actual value.

What we really need is better documentation — maybe a paragraph in tuning(7) that explains kern.maxswzone and vm.swzone.

Yea. Another paragraph from that part of that man pages says:

Running out of space for swap metadata can leave the system
in an unrecoverable state.  Therefore, you should only
change this parameter if you need to greatly extend the KVM
reservation for other resources such as the buffer cache or
kern.ipc.nmbclusters.  Modifies kernel option
VM_SWZONE_SIZE_MAX.

So there are, apparently, other considerations. I wonder if the "only change" wording should explicitly indicate a specific direction (increase vs. decrease) instead.