From owner-svn-src-head@FreeBSD.ORG Thu Jun 6 18:19:27 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 86D031E3; Thu, 6 Jun 2013 18:19:27 +0000 (UTC) (envelope-from attilio@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 5F6A710C6; Thu, 6 Jun 2013 18:19:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r56IJR2W048906; Thu, 6 Jun 2013 18:19:27 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r56IJRm1048904; Thu, 6 Jun 2013 18:19:27 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201306061819.r56IJRm1048904@svn.freebsd.org> From: Attilio Rao Date: Thu, 6 Jun 2013 18:19:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251471 - 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: Thu, 06 Jun 2013 18:19:27 -0000 Author: attilio Date: Thu Jun 6 18:19:26 2013 New Revision: 251471 URL: http://svnweb.freebsd.org/changeset/base/251471 Log: Complete r251452: Avoid to busy/unbusy a page in cases where there is no need to drop the vm_obj lock, more nominally when the page is full valid after vm_page_grab(). Sponsored by: EMC / Isilon storage division Reviewed by: alc Modified: head/sys/vm/swap_pager.c head/sys/vm/vm_glue.c Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Thu Jun 6 14:43:19 2013 (r251470) +++ head/sys/vm/swap_pager.c Thu Jun 6 18:19:26 2013 (r251471) @@ -1706,18 +1706,19 @@ swp_pager_force_pagein(vm_object_t objec vm_page_t m; vm_object_pip_add(object, 1); - m = vm_page_grab(object, pindex, VM_ALLOC_NORMAL|VM_ALLOC_RETRY); + m = vm_page_grab(object, pindex, VM_ALLOC_NORMAL | VM_ALLOC_RETRY | + VM_ALLOC_NOBUSY); if (m->valid == VM_PAGE_BITS_ALL) { vm_object_pip_subtract(object, 1); vm_page_dirty(m); vm_page_lock(m); vm_page_activate(m); vm_page_unlock(m); - vm_page_wakeup(m); vm_pager_page_unswapped(m); return; } + vm_page_busy(m); if (swap_pager_getpages(object, &m, 1, 0) != VM_PAGER_OK) panic("swap_pager_force_pagein: read from swap failed");/*XXX*/ vm_object_pip_subtract(object, 1); Modified: head/sys/vm/vm_glue.c ============================================================================== --- head/sys/vm/vm_glue.c Thu Jun 6 14:43:19 2013 (r251470) +++ head/sys/vm/vm_glue.c Thu Jun 6 18:19:26 2013 (r251471) @@ -241,8 +241,10 @@ vm_imgact_hold_page(vm_object_t object, VM_OBJECT_WLOCK(object); pindex = OFF_TO_IDX(offset); - m = vm_page_grab(object, pindex, VM_ALLOC_NORMAL | VM_ALLOC_RETRY); + m = vm_page_grab(object, pindex, VM_ALLOC_NORMAL | VM_ALLOC_RETRY | + VM_ALLOC_NOBUSY); if (m->valid != VM_PAGE_BITS_ALL) { + vm_page_busy(m); ma[0] = m; rv = vm_pager_get_pages(object, ma, 1, 0); m = vm_page_lookup(object, pindex); @@ -255,11 +257,11 @@ vm_imgact_hold_page(vm_object_t object, m = NULL; goto out; } + vm_page_wakeup(m); } vm_page_lock(m); vm_page_hold(m); vm_page_unlock(m); - vm_page_wakeup(m); out: VM_OBJECT_WUNLOCK(object); return (m);