Remove fromRename vm_page_object_remove the responsibility for removing a e to vm_page from its _remove_radix treedone, and remove
from it the responsibility for removing a page from its radix tree,
and pass that responsibility on to its callers.
For one of those callers, vm_page_rename, pass the responsibility along to its two callersa pages pctrie_iter,
rather than a page, and use the iterator to remove the page from its
radix tree. For another caller, vm_page_free_prep, add a boolean
parameter to indicate whether or not to remove the page from its radix
tree.
For each of themDefine functions vm_page_iter_remove() and vm_page_iter_free() that
are like vm_page_remove() and vm_page_free(), respectively, vm_object_split and vm_object_collapse_scanexcept
that they take an iterator as parameter rather than a page, use a pctrie_iter to walk over the pages of the objectand use
the iterator to remove the page from the radix tree instead of
searching the radix tree. Function vm_page_iter_free() is the
function that uses vm_page_free_prep with page removal disabled, and use vm_radix_iter_remove to removesince
it does the page from the object tree without searching fore removal its locationelf.
Define methodIn functions vm_page_remove_notreeobject_split and vm_page_free_notree that are just likeobject_collapse_scan, use a
pctrie_iter to walk over the original versionspages of the object, except that they don't tryand use
vm_radix_iter_remove to remove athe page from the radix treee object tree without
searching for its location.
Rewrite vm_object_page_remove to use iterators. Do the same with _kmem_unback.
Because vm_radix_iter_remove isn't defined yet, define it in vm_radix.h.
Because this code modifies the pindex of a page while it's in one treeSimilarly, and inserts it into another, before removing it from the first, relax the conditions in pctrie_iter_remove so that the leaf removed doesn't have to match the index associated with the iterator.rewrite vm_object_page_remove and _kmem_unback to use
iterators and vm_page_iter_free.