Page MenuHomeFreeBSD

swap_pager: Improve swzone warning
AcceptedPublic

Authored by des on Tue, Nov 11, 3:31 PM.
Tags
None
Referenced Files
F136888903: D53688.id.diff
Thu, Nov 20, 11:02 AM
F136886918: D53688.id166251.diff
Thu, Nov 20, 10:35 AM
F136882986: D53688.id166238.diff
Thu, Nov 20, 9:45 AM
F136882833: D53688.diff
Thu, Nov 20, 9:44 AM
Unknown Object (File)
Wed, Nov 19, 5:56 AM
Unknown Object (File)
Wed, Nov 19, 1:39 AM
Unknown Object (File)
Mon, Nov 17, 6:03 PM
Unknown Object (File)
Sun, Nov 16, 4:39 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 68540
Build 65423: 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.

I generally dislike such teaching printfs in kernel, it should be explained in man pages, while kernel only provide a concise values print. The long explanation, including description of units of output, and examples how to correct it, would go into tuning(7).

sys/vm/swap_pager.c
2689–2690

Wouldn't it be useful to show the swap_maxpages (without /2) in this case as well?

This revision is now accepted and ready to land.Wed, Nov 12, 12:30 AM