svn commit: r285056 - head/sys/kern

Mateusz Guzik mjg at FreeBSD.org
Thu Jul 2 19:03:45 UTC 2015


Author: mjg
Date: Thu Jul  2 19:03:44 2015
New Revision: 285056
URL: https://svnweb.freebsd.org/changeset/base/285056

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

Modified:
  head/sys/kern/sysv_shm.c

Modified: head/sys/kern/sysv_shm.c
==============================================================================
--- head/sys/kern/sysv_shm.c	Thu Jul  2 19:00:22 2015	(r285055)
+++ head/sys/kern/sysv_shm.c	Thu Jul  2 19:03:44 2015	(r285056)
@@ -380,10 +380,8 @@ kern_shmat_locked(struct thread *td, int
 		 * 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);


More information about the svn-src-all mailing list