From owner-svn-src-all@freebsd.org Thu Jul 2 19:03:45 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 13B429930E2; Thu, 2 Jul 2015 19:03:45 +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 05BB72D99; Thu, 2 Jul 2015 19:03:45 +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 t62J3iC1031797; Thu, 2 Jul 2015 19:03:44 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t62J3ilo031796; Thu, 2 Jul 2015 19:03:44 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201507021903.t62J3ilo031796@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 19:03:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285056 - head/sys/kern 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 19:03:45 -0000 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);