Page MenuHomeFreeBSD

Fix swap pager readahead after r292373.
ClosedPublic

Authored by markj on Aug 28 2016, 8:32 PM.
Tags
None
Referenced Files
Unknown Object (File)
Apr 2 2024, 12:34 AM
Unknown Object (File)
Mar 30 2024, 11:16 AM
Unknown Object (File)
Mar 2 2024, 5:39 AM
Unknown Object (File)
Feb 21 2024, 7:16 PM
Unknown Object (File)
Jan 11 2024, 8:11 PM
Unknown Object (File)
Dec 20 2023, 1:11 AM
Unknown Object (File)
Dec 15 2023, 5:29 PM
Unknown Object (File)
Dec 6 2023, 10:26 PM
Subscribers

Details

Summary

The removal of vm_fault_additional_pages() means that a hard fault on a
OBJT_SWAP-backed page will cause exactly one page to be read in. This
change restores readahead and readbehind for the swap pager in
swap_pager_getpages(). haspages() is modified to return the largest
contiguous non-resident range of pages in the swap block containing the
requested range.

Diff Detail

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

Event Timeline

markj retitled this revision from to Fix swap pager readahead after r292373..
markj edited the test plan for this revision. (Show Details)
markj updated this object.
sys/vm/swap_pager.c
1020 ↗(On Diff #19764)

Since you're already editing this line for functional reasons, I suggest changing the "++i" to the more idiomatic "i++".

1034 ↗(On Diff #19764)

Same here.

alc edited edge metadata.

This change looks correct to me. Thanks for doing it.

This revision is now accepted and ready to land.Aug 28 2016, 9:03 PM
markj edited edge metadata.

Style fix.

This revision now requires review to proceed.Aug 28 2016, 9:59 PM
kib edited edge metadata.
kib added inline comments.
sys/vm/swap_pager.c
1093 ↗(On Diff #19766)

May be, assert that the object paging count > 0 there ? I wonder should we increment it locally instead of relying on the caller.

This revision is now accepted and ready to land.Aug 29 2016, 4:22 AM
sys/vm/swap_pager.c
1093 ↗(On Diff #19766)

Hm, I deleted the comment that references the pip reference because I thought it wasn't true in all cases. For instance, a tmpfs read may page in from swap via uiomove_object_page(), but it looks like the paging count will be 0 in this case, and the stability of the backing store is instead provided by the vnode lock. Is this incorrect?

This revision was automatically updated to reflect the committed changes.