Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Jul 2015 18:30:13 +0000 (UTC)
From:      Mateusz Guzik <mjg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r285054 - head/sys/vm
Message-ID:  <201507021830.t62IUDcx013144@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mjg
Date: Thu Jul  2 18:30:12 2015
New Revision: 285054
URL: https://svnweb.freebsd.org/changeset/base/285054

Log:
  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

Modified:
  head/sys/vm/vm_mmap.c

Modified: head/sys/vm/vm_mmap.c
==============================================================================
--- head/sys/vm/vm_mmap.c	Thu Jul  2 18:27:18 2015	(r285053)
+++ head/sys/vm/vm_mmap.c	Thu Jul  2 18:30:12 2015	(r285054)
@@ -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) {
 		/*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201507021830.t62IUDcx013144>