From owner-svn-src-all@FreeBSD.ORG Fri Jun 18 23:14:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF7BA106566C; Fri, 18 Jun 2010 23:14:16 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B58EB8FC16; Fri, 18 Jun 2010 23:14:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5INEGcS000496; Fri, 18 Jun 2010 23:14:16 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5INEGuJ000494; Fri, 18 Jun 2010 23:14:16 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201006182314.o5INEGuJ000494@svn.freebsd.org> From: Alan Cox Date: Fri, 18 Jun 2010 23:14:16 +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: r209321 - head/sys/dev/cxgb/ulp/tom X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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: Fri, 18 Jun 2010 23:14:17 -0000 Author: alc Date: Fri Jun 18 23:14:16 2010 New Revision: 209321 URL: http://svn.freebsd.org/changeset/base/209321 Log: Catch up with the page and page queues locking changes. Modified: head/sys/dev/cxgb/ulp/tom/cxgb_vm.c Modified: head/sys/dev/cxgb/ulp/tom/cxgb_vm.c ============================================================================== --- head/sys/dev/cxgb/ulp/tom/cxgb_vm.c Fri Jun 18 22:12:12 2010 (r209320) +++ head/sys/dev/cxgb/ulp/tom/cxgb_vm.c Fri Jun 18 23:14:16 2010 (r209321) @@ -90,11 +90,9 @@ vm_fault_hold_user_pages(vm_map_t map, v * (and R/W if for write) if so just mark pages as held (and * dirty if for write) and return */ - vm_page_lock_queues(); for (pages = mp, faults = 0, va = addr; va < end; va += PAGE_SIZE, pages++) { /* - * page queue mutex is recursable so this is OK * it would be really nice if we had an unlocked * version of this so we were only acquiring the * pmap lock 1 time as opposed to potentially @@ -110,11 +108,13 @@ vm_fault_hold_user_pages(vm_map_t map, v * will never have the modified bit set if * they are only changed via DMA */ - if (prot & VM_PROT_WRITE) + if (prot & VM_PROT_WRITE) { + vm_page_lock_queues(); vm_page_dirty(m); + vm_page_unlock_queues(); + } } - vm_page_unlock_queues(); if (faults == 0) return (0); @@ -141,13 +141,13 @@ vm_fault_hold_user_pages(vm_map_t map, v error: log(LOG_WARNING, "vm_fault bad return rv=%d va=0x%zx\n", rv, va); - vm_page_lock_queues(); for (pages = mp, va = addr; va < end; va += PAGE_SIZE, pages++) if (*pages) { + vm_page_lock(*pages); vm_page_unhold(*pages); + vm_page_unlock(*pages); *pages = NULL; } - vm_page_unlock_queues(); return (EFAULT); } @@ -156,10 +156,10 @@ vm_fault_unhold_pages(vm_page_t *mp, int { KASSERT(count >= 0, ("negative count %d", count)); - vm_page_lock_queues(); while (count--) { + vm_page_lock(*mp); vm_page_unhold(*mp); + vm_page_unlock(*mp); mp++; } - vm_page_unlock_queues(); }