aboutsummaryrefslogtreecommitdiff
path: root/sys/amd64
diff options
context:
space:
mode:
authorAlan Cox <alc@FreeBSD.org>2002-04-18 03:28:27 +0000
committerAlan Cox <alc@FreeBSD.org>2002-04-18 03:28:27 +0000
commit6139043b1ffc16ba4d1d521cfd00abd833670722 (patch)
tree57e433fbfb84752f26c5e79b5807c33bcc47be22 /sys/amd64
parent1291e40d3d90ad884c838acf5ba0b07d55e7ad35 (diff)
downloadsrc-6139043b1ffc16ba4d1d521cfd00abd833670722.tar.gz
src-6139043b1ffc16ba4d1d521cfd00abd833670722.zip
o Call vm_map_growstack() from vm_fault() if vm_map_lookup() has failed
due to conditions that suggest the possible need for stack growth. This has two beneficial effects: (1) we can now remove calls to vm_map_growstack() from the MD trap handlers and (2) simple page faults are faster because we no longer unnecessarily perform vm_map_growstack() on every page fault. o Remove vm_map_growstack() from the i386's trap_pfault(). o Remove the acquisition and release of Giant from i386's trap_pfault(). (vm_fault() still acquires it.)
Notes
Notes: svn path=/head/; revision=94977
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/amd64/trap.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c
index 30af1b66a25b..d72689d8a799 100644
--- a/sys/amd64/amd64/trap.c
+++ b/sys/amd64/amd64/trap.c
@@ -703,7 +703,6 @@ trap_pfault(frame, usermode, eva)
else
ftype = VM_PROT_READ;
- mtx_lock(&Giant);
if (map != kernel_map) {
/*
* Keep swapout from messing with us during this
@@ -713,20 +712,8 @@ trap_pfault(frame, usermode, eva)
++p->p_lock;
PROC_UNLOCK(p);
- /*
- * Grow the stack if necessary
- */
- /* vm_map_growstack fails only if va falls into
- * a growable stack region and the stack growth
- * fails. It succeeds if va was not within
- * a growable stack region, or if the stack
- * growth succeeded.
- */
- if (vm_map_growstack(p, va) != KERN_SUCCESS)
- rv = KERN_FAILURE;
- else
- /* Fault in the user page: */
- rv = vm_fault(map, va, ftype,
+ /* Fault in the user page: */
+ rv = vm_fault(map, va, ftype,
(ftype & VM_PROT_WRITE) ? VM_FAULT_DIRTY
: VM_FAULT_NORMAL);
@@ -740,8 +727,6 @@ trap_pfault(frame, usermode, eva)
*/
rv = vm_fault(map, va, ftype, VM_FAULT_NORMAL);
}
- mtx_unlock(&Giant);
-
if (rv == KERN_SUCCESS)
return (0);
nogo: