From owner-svn-src-all@FreeBSD.ORG Mon May 11 05:16:58 2009 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 25F3B10656BC; Mon, 11 May 2009 05:16:58 +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 13F958FC2B; Mon, 11 May 2009 05:16:58 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4B5GvAE078609; Mon, 11 May 2009 05:16:57 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4B5Gv7O078608; Mon, 11 May 2009 05:16:57 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200905110516.n4B5Gv7O078608@svn.freebsd.org> From: Alan Cox Date: Mon, 11 May 2009 05:16:57 +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: r191986 - head/sys/kern 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: Mon, 11 May 2009 05:16:59 -0000 Author: alc Date: Mon May 11 05:16:57 2009 New Revision: 191986 URL: http://svn.freebsd.org/changeset/base/191986 Log: Revert CVS revision 1.94 (svn r16840). Current pmap implementations don't suffer from the race condition that motivated revision 1.94. Consequently, the work-around that was implemented by revision 1.94 is no longer needed. Moreover, reverting this work-around eliminates the need for vfs_busy_pages() to acquire the page queues lock when preparing a buffer for read. Reviewed by: tegge Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Mon May 11 04:57:40 2009 (r191985) +++ head/sys/kern/vfs_bio.c Mon May 11 05:16:57 2009 (r191986) @@ -3519,7 +3519,8 @@ retry: goto retry; } bogus = 0; - vm_page_lock_queues(); + if (clear_modify) + vm_page_lock_queues(); for (i = 0; i < bp->b_npages; i++) { m = bp->b_pages[i]; @@ -3542,17 +3543,18 @@ retry: * It may not work properly with small-block devices. * We need to find a better way. */ - pmap_remove_all(m); - if (clear_modify) + if (clear_modify) { + pmap_remove_write(m); vfs_page_set_valid(bp, foff, m); - else if (m->valid == VM_PAGE_BITS_ALL && + } else if (m->valid == VM_PAGE_BITS_ALL && (bp->b_flags & B_CACHE) == 0) { bp->b_pages[i] = bogus_page; bogus++; } foff = (foff + PAGE_SIZE) & ~(off_t)PAGE_MASK; } - vm_page_unlock_queues(); + if (clear_modify) + vm_page_unlock_queues(); VM_OBJECT_UNLOCK(obj); if (bogus) pmap_qenter(trunc_page((vm_offset_t)bp->b_data),