aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/kern_exec.c
diff options
context:
space:
mode:
authorAlan Cox <alc@FreeBSD.org>2013-06-06 06:17:20 +0000
committerAlan Cox <alc@FreeBSD.org>2013-06-06 06:17:20 +0000
commit27a18d6a2304fab3b0b71de432c27028e34eb4d6 (patch)
tree3a1e174973dd48f9da2206c49f231a4b36111937 /sys/kern/kern_exec.c
parentba39d89bc96ce6fa5f50d86768b6deb114f43ab1 (diff)
downloadsrc-27a18d6a2304fab3b0b71de432c27028e34eb4d6.tar.gz
src-27a18d6a2304fab3b0b71de432c27028e34eb4d6.zip
Don't busy the page unless we are likely to release the object lock.
Reviewed by: kib Sponsored by: EMC / Isilon Storage Division
Notes
Notes: svn path=/head/; revision=251452
Diffstat (limited to 'sys/kern/kern_exec.c')
-rw-r--r--sys/kern/kern_exec.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
index c45b97484498..c0e143595396 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -937,8 +937,10 @@ exec_map_first_page(imgp)
object->pg_color = 0;
}
#endif
- ma[0] = vm_page_grab(object, 0, VM_ALLOC_NORMAL | VM_ALLOC_RETRY);
+ ma[0] = vm_page_grab(object, 0, VM_ALLOC_NORMAL | VM_ALLOC_NOBUSY |
+ VM_ALLOC_RETRY);
if (ma[0]->valid != VM_PAGE_BITS_ALL) {
+ vm_page_busy(ma[0]);
initial_pagein = VM_INITIAL_PAGEIN;
if (initial_pagein > object->size)
initial_pagein = object->size;
@@ -968,11 +970,11 @@ exec_map_first_page(imgp)
VM_OBJECT_WUNLOCK(object);
return (EIO);
}
+ vm_page_wakeup(ma[0]);
}
vm_page_lock(ma[0]);
vm_page_hold(ma[0]);
vm_page_unlock(ma[0]);
- vm_page_wakeup(ma[0]);
VM_OBJECT_WUNLOCK(object);
imgp->firstpage = sf_buf_alloc(ma[0], 0);