Page MenuHomeFreeBSD

Fix swap pager readahead after r292373.
ClosedPublic

Authored by markj on Aug 28 2016, 8:32 PM.
Tags
None
Referenced Files
F107788345: D7677.diff
Sat, Jan 18, 5:11 AM
Unknown Object (File)
Sat, Jan 11, 4:39 PM
Unknown Object (File)
Nov 3 2024, 7:37 AM
Unknown Object (File)
Nov 3 2024, 7:37 AM
Unknown Object (File)
Nov 3 2024, 5:46 AM
Unknown Object (File)
Nov 2 2024, 10:28 AM
Unknown Object (File)
Nov 2 2024, 10:28 AM
Unknown Object (File)
Oct 16 2024, 1:07 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.