diff options
author | Matthew Dillon <dillon@FreeBSD.org> | 2001-07-04 16:20:28 +0000 |
---|---|---|
committer | Matthew Dillon <dillon@FreeBSD.org> | 2001-07-04 16:20:28 +0000 |
commit | 0cddd8f02397756cbeca5c5777d5895f3e419d88 (patch) | |
tree | 7420cce169451a74c5b87963467a4aeff668ed12 /sys/kern/imgact_aout.c | |
parent | d68b700a78ba6d4f1436aa6d21e47378a00a439b (diff) | |
download | src-0cddd8f02397756cbeca5c5777d5895f3e419d88.tar.gz src-0cddd8f02397756cbeca5c5777d5895f3e419d88.zip |
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.
Notes
Notes:
svn path=/head/; revision=79224
Diffstat (limited to 'sys/kern/imgact_aout.c')
-rw-r--r-- | sys/kern/imgact_aout.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/sys/kern/imgact_aout.c b/sys/kern/imgact_aout.c index 8becda31eb5c..856d4ec8fad6 100644 --- a/sys/kern/imgact_aout.c +++ b/sys/kern/imgact_aout.c @@ -91,6 +91,8 @@ exec_aout_imgact(imgp) unsigned long bss_size; int error; + GIANT_REQUIRED; + /* * Linux and *BSD binaries look very much alike, * only the machine id is different: @@ -171,7 +173,6 @@ exec_aout_imgact(imgp) if (error) return (error); - mtx_lock(&vm_mtx); /* * Destroy old process VM and create a new one (with a new stack) */ @@ -185,9 +186,7 @@ exec_aout_imgact(imgp) vp = imgp->vp; map = &vmspace->vm_map; vm_map_lock(map); - mtx_unlock(&vm_mtx); VOP_GETVOBJECT(vp, &object); - mtx_lock(&vm_mtx); vm_object_reference(object); text_end = virtual_offset + a_out->a_text; @@ -198,7 +197,6 @@ exec_aout_imgact(imgp) MAP_COPY_ON_WRITE | MAP_PREFAULT); if (error) { vm_map_unlock(map); - mtx_unlock(&vm_mtx); return (error); } data_end = text_end + a_out->a_data; @@ -211,7 +209,6 @@ exec_aout_imgact(imgp) MAP_COPY_ON_WRITE | MAP_PREFAULT); if (error) { vm_map_unlock(map); - mtx_unlock(&vm_mtx); return (error); } } @@ -222,7 +219,6 @@ exec_aout_imgact(imgp) VM_PROT_ALL, VM_PROT_ALL, 0); if (error) { vm_map_unlock(map); - mtx_unlock(&vm_mtx); return (error); } } @@ -235,8 +231,6 @@ exec_aout_imgact(imgp) vmspace->vm_daddr = (caddr_t) (uintptr_t) (virtual_offset + a_out->a_text); - mtx_unlock(&vm_mtx); - /* Fill in image_params */ imgp->interpreted = 0; imgp->entry_addr = a_out->a_entry; |