Page MenuHomeFreeBSD

swap_pager: small improvement to find_least
ClosedPublic

Authored by dougm on Jun 11 2024, 7:38 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, May 20, 3:19 AM
Unknown Object (File)
Tue, May 12, 11:25 AM
Unknown Object (File)
Mon, May 11, 9:56 PM
Unknown Object (File)
Mon, May 11, 9:56 PM
Unknown Object (File)
May 3 2026, 7:20 PM
Unknown Object (File)
Apr 30 2026, 7:02 AM
Unknown Object (File)
Apr 28 2026, 9:07 AM
Unknown Object (File)
Apr 26 2026, 3:02 PM
Subscribers

Details

Summary

This change drops an unneeded test, a branch and avoids a needless computation. Altogether, it saves 10 bytes of instructions on amd64.

It will mean that, on the path to MPASS(0), the same lookup and iteration will happen twice.

Test Plan

The kernel still boots.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

dougm requested review of this revision.Jun 11 2024, 7:38 AM
dougm created this revision.
kib added inline comments.
sys/vm/swap_pager.c
2279
2312

Perhaps it is the time to change these two lines into __unreachable().

This revision is now accepted and ready to land.Jun 11 2024, 2:39 PM
This revision was automatically updated to reflect the committed changes.