From 6cbd8f24b910e195dc43695599da470550138fcf Mon Sep 17 00:00:00 2001 From: alc Date: Sun, 17 Mar 2013 20:40:31 +0000 Subject: [PATCH] The calls to vm_radix_lookup_ge() by vm_reserv_alloc_{contig,page}() can be eliminated. If the calls to vm_radix_lookup_le() return NULL, then the page at the head of the object's memq must be the page with the least pindex greater than the specified pindex. Reviewed by: attilio Sponsored by: EMC / Isilon Storage Division --- sys/vm/vm_reserv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/vm/vm_reserv.c b/sys/vm/vm_reserv.c index bb071bd78938..4d36385e6963 100644 --- a/sys/vm/vm_reserv.c +++ b/sys/vm/vm_reserv.c @@ -352,7 +352,7 @@ vm_reserv_alloc_contig(vm_object_t object, vm_pindex_t pindex, u_long npages, goto found; msucc = TAILQ_NEXT(mpred, listq); } else - msucc = vm_radix_lookup_ge(&object->rtree, pindex); + msucc = TAILQ_FIRST(&object->memq); if (msucc != NULL) { KASSERT(msucc->pindex > pindex, ("vm_reserv_alloc_page: pindex already allocated")); @@ -507,7 +507,7 @@ vm_reserv_alloc_page(vm_object_t object, vm_pindex_t pindex) goto found; msucc = TAILQ_NEXT(mpred, listq); } else - msucc = vm_radix_lookup_ge(&object->rtree, pindex); + msucc = TAILQ_FIRST(&object->memq); if (msucc != NULL) { KASSERT(msucc->pindex > pindex, ("vm_reserv_alloc_page: pindex already allocated"));