From owner-svn-src-head@FreeBSD.ORG Fri May 17 19:02:37 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 58FCFBB; Fri, 17 May 2013 19:02:37 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4C5B58C; Fri, 17 May 2013 19:02:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4HJ2btY078460; Fri, 17 May 2013 19:02:37 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4HJ2bHl078459; Fri, 17 May 2013 19:02:37 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201305171902.r4HJ2bHl078459@svn.freebsd.org> From: Alan Cox Date: Fri, 17 May 2013 19:02:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250748 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 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, 17 May 2013 19:02:37 -0000 Author: alc Date: Fri May 17 19:02:36 2013 New Revision: 250748 URL: http://svnweb.freebsd.org/changeset/base/250748 Log: Relax the object locking in vm_fault_prefault(). A read lock suffices. Reviewed by: attilio Sponsored by: EMC / Isilon Storage Division Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Fri May 17 18:59:00 2013 (r250747) +++ head/sys/vm/vm_fault.c Fri May 17 19:02:36 2013 (r250748) @@ -1044,28 +1044,28 @@ vm_fault_prefault(pmap_t pmap, vm_offset pindex = ((addr - entry->start) + entry->offset) >> PAGE_SHIFT; lobject = object; - VM_OBJECT_WLOCK(lobject); + VM_OBJECT_RLOCK(lobject); while ((m = vm_page_lookup(lobject, pindex)) == NULL && lobject->type == OBJT_DEFAULT && (backing_object = lobject->backing_object) != NULL) { KASSERT((lobject->backing_object_offset & PAGE_MASK) == 0, ("vm_fault_prefault: unaligned object offset")); pindex += lobject->backing_object_offset >> PAGE_SHIFT; - VM_OBJECT_WLOCK(backing_object); - VM_OBJECT_WUNLOCK(lobject); + VM_OBJECT_RLOCK(backing_object); + VM_OBJECT_RUNLOCK(lobject); lobject = backing_object; } /* * give-up when a page is not in memory */ if (m == NULL) { - VM_OBJECT_WUNLOCK(lobject); + VM_OBJECT_RUNLOCK(lobject); break; } if (m->valid == VM_PAGE_BITS_ALL && (m->flags & PG_FICTITIOUS) == 0) pmap_enter_quick(pmap, addr, m, entry->protection); - VM_OBJECT_WUNLOCK(lobject); + VM_OBJECT_RUNLOCK(lobject); } }