Page MenuHomeFreeBSD

swap_pager: Unbusy readahead pages after an I/O error
ClosedPublic

Authored by markj on Apr 5 2024, 7:16 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Oct 14, 9:14 PM
Unknown Object (File)
Tue, Oct 14, 9:14 PM
Unknown Object (File)
Tue, Oct 14, 9:14 PM
Unknown Object (File)
Tue, Oct 14, 9:14 PM
Unknown Object (File)
Tue, Oct 14, 11:43 AM
Unknown Object (File)
Sep 6 2025, 1:08 AM
Unknown Object (File)
Sep 4 2025, 10:41 PM
Unknown Object (File)
Sep 4 2025, 3:26 AM
Subscribers

Details

Summary

The swap pager itself allocates readahead pages, so should take care to
unbusy them after a read error, just as it does in the non-error case.

PR: 277538

Diff Detail

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

Event Timeline

markj requested review of this revision.Apr 5 2024, 7:16 PM
sys/vm/swap_pager.c
1689

Then why leave invalid pages on the object queue?
More, moving invalid pages to inactive queue does not sound right.

sys/vm/swap_pager.c
1689

I think it's possible in principle for the page to be wired. So, the code needs to look like this:

if (!vm_page_wired(m) || vm_page_remove(m))
        vm_page_free(m);

It seemed more straightforward to just release the page to the head of the inactive queue (_noreuse) in this rare case. There is no problem with having invalid pages on the inactive queue.

sys/vm/swap_pager.c
1689

There is vm_page_free_invalid()

markj marked an inline comment as done.

Use vm_page_free_invalid().

This revision is now accepted and ready to land.Apr 5 2024, 9:27 PM