- Make use of the VM_ALLOC_WIRED flag in the call to vm_page_alloc() in

do_sendfile().  This allows us to rearrange an if statement in order to
  avoid doing an unnecesary call to vm_page_lock_queues(), and an attempt
  at re-wiring the pages (which were wired in the vm_page_alloc() call).

Reviewed by:	alc, jhb
This commit is contained in:
arr 2002-07-23 01:09:34 +00:00
parent d5467bd904
commit 249ad7ccdb

View File

@ -1782,25 +1782,25 @@ retry_lookup:
pg = vm_page_lookup(obj, pindex);
if (pg == NULL) {
pg = vm_page_alloc(obj, pindex, VM_ALLOC_NORMAL);
pg = vm_page_alloc(obj, pindex,
VM_ALLOC_NORMAL | VM_ALLOC_WIRED);
if (pg == NULL) {
VM_WAIT;
goto retry_lookup;
}
vm_page_wakeup(pg);
} else if (vm_page_sleep_busy(pg, TRUE, "sfpbsy")) {
goto retry_lookup;
} else {
if (vm_page_sleep_busy(pg, TRUE, "sfpbsy"))
goto retry_lookup;
/*
* Wire the page so it does not get ripped out from
* under us.
*/
vm_page_lock_queues();
vm_page_wire(pg);
vm_page_unlock_queues();
}
/*
* Wire the page so it does not get ripped out from under
* us.
*/
vm_page_lock_queues();
vm_page_wire(pg);
vm_page_unlock_queues();
/*
* If page is not valid for what we need, initiate I/O
*/