From owner-svn-src-head@FreeBSD.ORG Fri Apr 6 18:18:48 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A89E71065672; Fri, 6 Apr 2012 18:18:48 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 89C0E8FC0A; Fri, 6 Apr 2012 18:18:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q36IImYN020739; Fri, 6 Apr 2012 18:18:48 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q36IImkw020737; Fri, 6 Apr 2012 18:18:48 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201204061818.q36IImkw020737@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 6 Apr 2012 18:18:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233957 - head/sys/powerpc/aim X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Apr 2012 18:18:48 -0000 Author: nwhitehorn Date: Fri Apr 6 18:18:48 2012 New Revision: 233957 URL: http://svn.freebsd.org/changeset/base/233957 Log: Substantially reduce the scope of the locks held in pmap_enter(), which improves concurrency slightly. Modified: head/sys/powerpc/aim/mmu_oea64.c Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Fri Apr 6 17:49:11 2012 (r233956) +++ head/sys/powerpc/aim/mmu_oea64.c Fri Apr 6 18:18:48 2012 (r233957) @@ -284,8 +284,6 @@ static struct pvo_entry *moea64_pvo_find /* * Utility routines. */ -static void moea64_enter_locked(mmu_t, pmap_t, vm_offset_t, - vm_page_t, vm_prot_t, boolean_t); static boolean_t moea64_query_bit(mmu_t, vm_page_t, u_int64_t); static u_int moea64_clear_bit(mmu_t, vm_page_t, u_int64_t); static void moea64_kremove(mmu_t, vm_offset_t); @@ -1168,30 +1166,11 @@ moea64_zero_page_idle(mmu_t mmu, vm_page * target pmap with the protection requested. If specified the page * will be wired down. */ + void moea64_enter(mmu_t mmu, pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, boolean_t wired) { - - LOCK_TABLE_WR(); - PMAP_LOCK(pmap); - moea64_enter_locked(mmu, pmap, va, m, prot, wired); - UNLOCK_TABLE_WR(); - PMAP_UNLOCK(pmap); -} - -/* - * Map the given physical page at the specified virtual address in the - * target pmap with the protection requested. If specified the page - * will be wired down. - * - * The table (write) and pmap must be locked. - */ - -static void -moea64_enter_locked(mmu_t mmu, pmap_t pmap, vm_offset_t va, vm_page_t m, - vm_prot_t prot, boolean_t wired) -{ struct pvo_head *pvo_head; uma_zone_t zone; vm_page_t pg; @@ -1211,10 +1190,9 @@ moea64_enter_locked(mmu_t mmu, pmap_t pm pvo_flags = PVO_MANAGED; } - PMAP_LOCK_ASSERT(pmap, MA_OWNED); KASSERT((m->oflags & (VPO_UNMANAGED | VPO_BUSY)) != 0 || VM_OBJECT_LOCKED(m->object), - ("moea64_enter_locked: page %p is not busy", m)); + ("moea64_enter: page %p is not busy", m)); /* XXX change the pvo head for fake pages */ if ((m->oflags & VPO_UNMANAGED) != 0) { @@ -1239,8 +1217,12 @@ moea64_enter_locked(mmu_t mmu, pmap_t pm if (wired) pvo_flags |= PVO_WIRED; + LOCK_TABLE_WR(); + PMAP_LOCK(pmap); error = moea64_pvo_enter(mmu, pmap, zone, pvo_head, va, VM_PAGE_TO_PHYS(m), pte_lo, pvo_flags); + PMAP_UNLOCK(pmap); + UNLOCK_TABLE_WR(); /* * Flush the page from the instruction cache if this page is @@ -1311,15 +1293,11 @@ moea64_enter_object(mmu_t mmu, pmap_t pm psize = atop(end - start); m = m_start; - LOCK_TABLE_WR(); - PMAP_LOCK(pm); while (m != NULL && (diff = m->pindex - m_start->pindex) < psize) { - moea64_enter_locked(mmu, pm, start + ptoa(diff), m, prot & + moea64_enter(mmu, pm, start + ptoa(diff), m, prot & (VM_PROT_READ | VM_PROT_EXECUTE), FALSE); m = TAILQ_NEXT(m, listq); } - UNLOCK_TABLE_WR(); - PMAP_UNLOCK(pm); } void @@ -1327,12 +1305,8 @@ moea64_enter_quick(mmu_t mmu, pmap_t pm, vm_prot_t prot) { - LOCK_TABLE_WR(); - PMAP_LOCK(pm); - moea64_enter_locked(mmu, pm, va, m, + moea64_enter(mmu, pm, va, m, prot & (VM_PROT_READ | VM_PROT_EXECUTE), FALSE); - UNLOCK_TABLE_WR(); - PMAP_UNLOCK(pm); } vm_paddr_t