From owner-svn-src-all@freebsd.org Thu Jul 2 18:30:13 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F16C993B58; Thu, 2 Jul 2015 18:30:13 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 71272192D; Thu, 2 Jul 2015 18:30:13 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t62IUDuG013145; Thu, 2 Jul 2015 18:30:13 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t62IUDcx013144; Thu, 2 Jul 2015 18:30:13 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201507021830.t62IUDcx013144@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 2 Jul 2015 18:30:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285054 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 18:30:13 -0000 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) { /*