From cabea246201abda4a7da1d0299c2f5f505e885b2 Mon Sep 17 00:00:00 2001 From: alc Date: Thu, 5 Feb 2004 06:33:18 +0000 Subject: [PATCH] - Locking for the per-process resource limits structure has eliminated the need for Giant in vm_map_growstack(). - Use the proc * that is passed to vm_map_growstack() rather than curthread->td_proc. --- sys/vm/vm_fault.c | 2 -- sys/vm/vm_map.c | 4 +--- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c index 567926e180fa..fe33cbf349a6 100644 --- a/sys/vm/vm_fault.c +++ b/sys/vm/vm_fault.c @@ -236,9 +236,7 @@ RetryFault:; (fault_flags & VM_FAULT_WIRE_MASK) != VM_FAULT_USER_WIRE) { if (growstack && result == KERN_INVALID_ADDRESS && map != kernel_map && curproc != NULL) { - mtx_lock(&Giant); result = vm_map_growstack(curproc, vaddr); - mtx_unlock(&Giant); if (result != KERN_SUCCESS) return (KERN_FAILURE); growstack = FALSE; diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index 5c93a84acc62..8c5a50289026 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -2573,12 +2573,10 @@ vm_map_growstack(struct proc *p, vm_offset_t addr) rlim_t stacklim, vmemlim; int is_procstack, rv; - GIANT_REQUIRED; - Retry: PROC_LOCK(p); stacklim = lim_cur(p, RLIMIT_STACK); - vmemlim = lim_cur(curthread->td_proc, RLIMIT_VMEM); + vmemlim = lim_cur(p, RLIMIT_VMEM); PROC_UNLOCK(p); vm_map_lock_read(map);