1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-24 11:29:10 +00:00

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
This commit is contained in:
Mateusz Guzik 2015-07-02 18:30:12 +00:00
parent 6c5f7b239f
commit cd336bad26
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=285054

View File

@ -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) {
/*