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.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
sys/vm/vm_page.c | ||
---|---|---|
5012 | Need to reset the iterator here. |
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. |