HomeFreeBSD

swapoff_one(): only check free pages count manually turning swap off

Description

swapoff_one(): only check free pages count manually turning swap off

When swap is turned off due to system shutdown or reboot, ignore the
check. Problem is that the check is not accurate by any means, free
page count can legitimately be low while system still able to page in
everything from the swap. Then, we turn swap off if swapping on
real file or some non-standard geom provider, and typically panic
when system appears to actually need to unavailable page.

For syscall, it is better to be safe than sorry.

Reported and tested by: peterj
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D33147

Details

Provenance
kibAuthored on Nov 26 2021, 11:22 PM
Reviewer
markj
Differential Revision
D33147: Make swapoff more robust, when using swap into file
Parents
rG8661e085fb95: mmc: Fix HS200/HS400 capability check
Branches
Unknown
Tags
Unknown