sysvshm: don't lock proc when calculating attach_va

vm_daddr is constant and RLIMIT_DATA can be obtained from thread's copy of
rlimits.
This commit is contained in:
Mateusz Guzik 2015-07-02 19:03:44 +00:00
parent 0be3a191a4
commit 77a26248a3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=285056

View File

@ -380,10 +380,8 @@ kern_shmat_locked(struct thread *td, int shmid, const void *shmaddr,
* This is just a hint to vm_map_find() about where to
* put it.
*/
PROC_LOCK(p);
attach_va = round_page((vm_offset_t)p->p_vmspace->vm_daddr +
lim_max_proc(p, RLIMIT_DATA));
PROC_UNLOCK(p);
lim_max(td, RLIMIT_DATA));
}
vm_object_reference(shmseg->object);