Page MenuHomeFreeBSD

vm_grab_valid: make one with iter param
ClosedPublic

Authored by dougm on Mon, Apr 21, 5:36 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 25, 11:12 PM
Unknown Object (File)
Fri, Apr 25, 12:24 PM
Unknown Object (File)
Fri, Apr 25, 9:14 AM
Unknown Object (File)
Fri, Apr 25, 6:07 AM
Unknown Object (File)
Fri, Apr 25, 2:34 AM
Unknown Object (File)
Fri, Apr 25, 1:36 AM
Unknown Object (File)
Thu, Apr 24, 7:18 PM
Unknown Object (File)
Wed, Apr 23, 4:11 AM
Subscribers

Details

Summary

Define vm_page_grab_valid_iter() to be the function that does the work of vm_page_grab(), but has an iterator parameter passed to it. In a couple of places, this can be called directly to let an iterator get reused.

Diff Detail

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

Event Timeline

dougm requested review of this revision.Mon, Apr 21, 5:36 PM
sys/vm/vm_page.c
5012

Need to reset the iterator here.

dougm marked an inline comment as done.
sys/vm/vm_page.c
5017

Sadly, it's possible for vm_pager_has_page() to drop the object lock, see vnode_pager_haspage() for an example. So the iterator needs to be reinited after this point.

More generally, I think it's ok to assume that vm_pager_has_page() does not drop the object lock if the VM object is swap-backed, and in particular, if it has OBJ_ANON set. While that's not always true here, I think the use in vm_object_collapse_scan() is safe with respect to iterators.

Add necessary iterator resets.

This revision is now accepted and ready to land.Thu, Apr 24, 1:30 PM
This revision was automatically updated to reflect the committed changes.