vm_page: use iterators in page allocaction
Change vm_page_alloc_after() and vm_page_alloc_domain_after() to take
a page iterator argument, to allow for faster insertion into the radix
trie of pages. Where a caller of one of those functions doesn't
already have a page iterator to use, define one. Where vm_page_grab()
is invoked in a loop, invoke a new version with an iterator argument,
and pass the same iterator in each call. Make sure that
vm_page_alloc_after() and vm_page_alloc_domain_after() return with the
iterator in a valid state, even when the object lock was briefly lost
and regained.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D49688