diff options
author | mjg <mjg@FreeBSD.org> | 2015-07-02 18:30:12 +0000 |
---|---|---|
committer | mjg <mjg@FreeBSD.org> | 2015-07-02 18:30:12 +0000 |
commit | 93aba404ec2c3ce29e9b8e40514d5f93d52b9db5 (patch) | |
tree | 9799773823c7c965e53c7f750b92adaa157572dd /sys/vm/vm_mmap.c | |
parent | 53070d52a74def25603a24c3a04809200c45654d (diff) | |
download | FreeBSD-src-93aba404ec2c3ce29e9b8e40514d5f93d52b9db5.zip FreeBSD-src-93aba404ec2c3ce29e9b8e40514d5f93d52b9db5.tar.gz |
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
Diffstat (limited to 'sys/vm/vm_mmap.c')
-rw-r--r-- | sys/vm/vm_mmap.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c index d331a9b..8118c0a 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) { /* |