From cd336bad261a81036b48bb393cbc4f50cbe350a9 Mon Sep 17 00:00:00 2001 From: Mateusz Guzik Date: Thu, 2 Jul 2015 18:30:12 +0000 Subject: [PATCH] vm: don't lock proc around accesses to vm_{t,d}addr and RLIMIT_DATA in sys_mmap vm_{t,d}addr are constant and we can use thread's copy of resource limits --- sys/vm/vm_mmap.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c index d331a9b22a2..8118c0ae2fe 100644 --- a/sys/vm/vm_mmap.c +++ b/sys/vm/vm_mmap.c @@ -312,14 +312,12 @@ sys_mmap(td, uap) * There should really be a pmap call to determine a reasonable * location. */ - PROC_LOCK(td->td_proc); if (addr == 0 || (addr >= round_page((vm_offset_t)vms->vm_taddr) && addr < round_page((vm_offset_t)vms->vm_daddr + - lim_max_proc(td->td_proc, RLIMIT_DATA)))) + lim_max(td, RLIMIT_DATA)))) addr = round_page((vm_offset_t)vms->vm_daddr + - lim_max_proc(td->td_proc, RLIMIT_DATA)); - PROC_UNLOCK(td->td_proc); + lim_max(td, RLIMIT_DATA)); } if (size == 0) { /*