From e028603b7e3e4fb35cdf00aab533f3965f4a13cc Mon Sep 17 00:00:00 2001 From: dillon Date: Wed, 4 Jul 2001 16:20:28 +0000 Subject: 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. --- sys/kern/imgact_aout.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'sys/kern/imgact_aout.c') diff --git a/sys/kern/imgact_aout.c b/sys/kern/imgact_aout.c index 8becda3..856d4ec 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; -- cgit v1.1