Page MenuHomeFreeBSD

Allow swap_pager_putpages() to allocate one block at a time.
ClosedPublic

Authored by markj on Feb 19 2020, 8:41 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sep 13 2025, 11:45 PM
Unknown Object (File)
Sep 9 2025, 4:08 PM
Unknown Object (File)
Sep 4 2025, 5:17 AM
Unknown Object (File)
Sep 3 2025, 6:09 PM
Unknown Object (File)
Aug 13 2025, 8:43 AM
Unknown Object (File)
Aug 12 2025, 11:14 PM
Unknown Object (File)
Aug 8 2025, 7:50 PM
Unknown Object (File)
Jul 10 2025, 11:06 AM
Subscribers

Details

Summary

Alan points out that the minimum allocation size of 4 blocks is an old
policy that came with the "new" swap pager in r42957. Since then the
blist allocator has gotten better at minimizing fragmentation; for
example, with r349777 it can return a range that spans multiple leaves.
When swap space is close to being exhaused, the minimum of 4 blocks most
likely exacerbates things. Reduce it to 1.

Test Plan

Peter reported no problems.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj edited the test plan for this revision. (Show Details)
markj added reviewers: alc, dougm, kib, jeff.
This revision is now accepted and ready to land.Feb 20 2020, 1:39 PM

This change makes the second argument to swp_pager_getswapspace redundant. A future change might as well eliminate it.

This change makes the second argument to swp_pager_getswapspace redundant. A future change might as well eliminate it.

Indeed. I didn't bother since that change doesn't really simplify swp_pager_getswapspace() at all, but it seems reasonable to me.