From owner-svn-src-all@FreeBSD.ORG Sat Mar 28 02:36:51 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3AAFAC66; Sat, 28 Mar 2015 02:36:51 +0000 (UTC) Received: from svn.freebsd.org (svn.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 0C431C65; Sat, 28 Mar 2015 02:36:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2S2aoPl032744; Sat, 28 Mar 2015 02:36:50 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2S2aoeI032743; Sat, 28 Mar 2015 02:36:50 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201503280236.t2S2aoeI032743@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Sat, 28 Mar 2015 02:36:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280774 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 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: Sat, 28 Mar 2015 02:36:51 -0000 Author: jeff Date: Sat Mar 28 02:36:49 2015 New Revision: 280774 URL: https://svnweb.freebsd.org/changeset/base/280774 Log: - Eliminate pagequeue locking in the dirty code in vm_pageout_scan(). - Use a more precise series of tests to see if the page changed while we were locking the vnode. Reviewed by: alc Sponsored by: EMC / Isilon Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Sat Mar 28 01:11:18 2015 (r280773) +++ head/sys/vm/vm_pageout.c Sat Mar 28 02:36:49 2015 (r280774) @@ -1157,6 +1157,7 @@ vm_pageout_scan(struct vm_domain *vmd, i int swap_pageouts_ok; struct vnode *vp = NULL; struct mount *mp = NULL; + vm_pindex_t pindex; if ((object->type != OBJT_SWAP) && (object->type != OBJT_DEFAULT)) { swap_pageouts_ok = 1; @@ -1217,6 +1218,7 @@ vm_pageout_scan(struct vm_domain *vmd, i KASSERT(mp != NULL, ("vp %p with NULL v_mount", vp)); vm_object_reference_locked(object); + pindex = m->pindex; VM_OBJECT_WUNLOCK(object); lockmode = MNT_SHARED_WRITES(vp->v_mount) ? LK_SHARED : LK_EXCLUSIVE; @@ -1231,17 +1233,18 @@ vm_pageout_scan(struct vm_domain *vmd, i } VM_OBJECT_WLOCK(object); vm_page_lock(m); - vm_pagequeue_lock(pq); - queues_locked = TRUE; /* - * The page might have been moved to another - * queue during potential blocking in vget() - * above. The page might have been freed and - * reused for another vnode. + * While the object and page were unlocked, + * the page may have been + * (1) moved to a different queue, + * (2) reallocated to a different object, + * (3) reallocated to a different offset, or + * (4) cleaned. */ if (m->queue != PQ_INACTIVE || m->object != object || - TAILQ_NEXT(m, plinks.q) != &vmd->vmd_marker) { + m->pindex != pindex || + m->dirty == 0) { vm_page_unlock(m); if (object->flags & OBJ_MIGHTBEDIRTY) vnodes_skipped++; @@ -1271,8 +1274,6 @@ vm_pageout_scan(struct vm_domain *vmd, i vnodes_skipped++; goto unlock_and_continue; } - vm_pagequeue_unlock(pq); - queues_locked = FALSE; } /* @@ -1293,10 +1294,6 @@ unlock_and_continue: vm_page_lock_assert(m, MA_NOTOWNED); VM_OBJECT_WUNLOCK(object); if (mp != NULL) { - if (queues_locked) { - vm_pagequeue_unlock(pq); - queues_locked = FALSE; - } if (vp != NULL) vput(vp); vm_object_deallocate(object);