From d7bc9285a673d676370f95a84ce93ef553c8688c Mon Sep 17 00:00:00 2001 From: mjg Date: Wed, 10 Jun 2015 10:48:12 +0000 Subject: Implement lockless resource limits. Use the same scheme implemented to manage credentials. Code needing to look at process's credentials (as opposed to thred's) is provided with *_proc variants of relevant functions. Places which possibly had to take the proc lock anyway still use the proc pointer to access limits. --- sys/vm/vm_unix.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'sys/vm/vm_unix.c') diff --git a/sys/vm/vm_unix.c b/sys/vm/vm_unix.c index cc77ff7..201c13b 100644 --- a/sys/vm/vm_unix.c +++ b/sys/vm/vm_unix.c @@ -83,11 +83,9 @@ sys_obreak(td, uap) int error = 0; boolean_t do_map_wirefuture; - PROC_LOCK(td->td_proc); - datalim = lim_cur(td->td_proc, RLIMIT_DATA); - lmemlim = lim_cur(td->td_proc, RLIMIT_MEMLOCK); - vmemlim = lim_cur(td->td_proc, RLIMIT_VMEM); - PROC_UNLOCK(td->td_proc); + datalim = lim_cur(td, RLIMIT_DATA); + lmemlim = lim_cur(td, RLIMIT_MEMLOCK); + vmemlim = lim_cur(td, RLIMIT_VMEM); do_map_wirefuture = FALSE; new = round_page((vm_offset_t)uap->nsize); -- cgit v1.1