summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_exec.c
diff options
context:
space:
mode:
authordillon <dillon@FreeBSD.org>2001-07-04 16:20:28 +0000
committerdillon <dillon@FreeBSD.org>2001-07-04 16:20:28 +0000
commite028603b7e3e4fb35cdf00aab533f3965f4a13cc (patch)
tree7420cce169451a74c5b87963467a4aeff668ed12 /sys/kern/kern_exec.c
parent0b028660051eb7abf4306d34e7fec0e7fde86a28 (diff)
downloadFreeBSD-src-e028603b7e3e4fb35cdf00aab533f3965f4a13cc.zip
FreeBSD-src-e028603b7e3e4fb35cdf00aab533f3965f4a13cc.tar.gz
With Alfred's permission, remove vm_mtx in favor of a fine-grained approach
(this commit is just the first stage). Also add various GIANT_ macros to formalize the removal of Giant, making it easy to test in a more piecemeal fashion. These macros will allow us to test fine-grained locks to a degree before removing Giant, and also after, and to remove Giant in a piecemeal fashion via sysctl's on those subsystems which the authors believe can operate without Giant.
Diffstat (limited to 'sys/kern/kern_exec.c')
-rw-r--r--sys/kern/kern_exec.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
index ecadfed..2e0b60c 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -445,13 +445,13 @@ exec_map_first_page(imgp)
vm_page_t ma[VM_INITIAL_PAGEIN];
vm_object_t object;
+ GIANT_REQUIRED;
if (imgp->firstpage) {
exec_unmap_first_page(imgp);
}
VOP_GETVOBJECT(imgp->vp, &object);
- mtx_lock(&vm_mtx);
ma[0] = vm_page_grab(object, 0, VM_ALLOC_NORMAL | VM_ALLOC_RETRY);
@@ -482,7 +482,6 @@ exec_map_first_page(imgp)
vm_page_protect(ma[0], VM_PROT_NONE);
vm_page_free(ma[0]);
}
- mtx_unlock(&vm_mtx);
return EIO;
}
}
@@ -493,7 +492,6 @@ exec_map_first_page(imgp)
pmap_kenter((vm_offset_t) imgp->image_header, VM_PAGE_TO_PHYS(ma[0]));
imgp->firstpage = ma[0];
- mtx_unlock(&vm_mtx);
return 0;
}
@@ -501,12 +499,11 @@ void
exec_unmap_first_page(imgp)
struct image_params *imgp;
{
+ GIANT_REQUIRED;
if (imgp->firstpage) {
- mtx_lock(&vm_mtx);
pmap_kremove((vm_offset_t) imgp->image_header);
vm_page_unwire(imgp->firstpage, 1);
- mtx_unlock(&vm_mtx);
imgp->firstpage = NULL;
}
}
@@ -525,7 +522,8 @@ exec_new_vmspace(imgp)
caddr_t stack_addr = (caddr_t) (USRSTACK - MAXSSIZ);
vm_map_t map = &vmspace->vm_map;
- mtx_assert(&vm_mtx, MA_OWNED);
+ GIANT_REQUIRED;
+
imgp->vmspace_destroyed = 1;
/*
OpenPOWER on IntegriCloud