summaryrefslogtreecommitdiffstats
path: root/sys/kern/uipc_syscalls.c
diff options
context:
space:
mode:
authorarr <arr@FreeBSD.org>2002-07-23 01:09:34 +0000
committerarr <arr@FreeBSD.org>2002-07-23 01:09:34 +0000
commit249ad7ccdbe7f8743ffc961a2d41e284e161a7b0 (patch)
treebe4d824ad6aee97c99551f5dc52f0787f3594e8d /sys/kern/uipc_syscalls.c
parentd5467bd90457e7c7518778b71da02e263b67a69a (diff)
downloadFreeBSD-src-249ad7ccdbe7f8743ffc961a2d41e284e161a7b0.zip
FreeBSD-src-249ad7ccdbe7f8743ffc961a2d41e284e161a7b0.tar.gz
- 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
Diffstat (limited to 'sys/kern/uipc_syscalls.c')
-rw-r--r--sys/kern/uipc_syscalls.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c
index a41b842..498dccb 100644
--- a/sys/kern/uipc_syscalls.c
+++ b/sys/kern/uipc_syscalls.c
@@ -1782,26 +1782,26 @@ 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
*/
OpenPOWER on IntegriCloud