From owner-svn-src-head@FreeBSD.ORG Thu May 28 06:52:15 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C7C6106566B; Thu, 28 May 2009 06:52:15 +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 EF7C68FC14; Thu, 28 May 2009 06:52:14 +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 n4S6qEHZ025967; Thu, 28 May 2009 06:52:14 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4S6qEYn025966; Thu, 28 May 2009 06:52:14 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200905280652.n4S6qEYn025966@svn.freebsd.org> From: Alan Cox Date: Thu, 28 May 2009 06:52:14 +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: r192962 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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, 28 May 2009 06:52:15 -0000 Author: alc Date: Thu May 28 06:52:14 2009 New Revision: 192962 URL: http://svn.freebsd.org/changeset/base/192962 Log: Revise vm_pageout_scan()'s handling of partially dirty pages. Specifically, rather than unconditionally making partially dirty pages fully dirty, only make partially dirty pages fully dirty if the pmap says that the page has been modified. (This change is also a small optimization. It eliminate an unnecessary call to pmap_is_modified() on pages that are mapped read only.) Suggested by: tegge Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Thu May 28 06:39:11 2009 (r192961) +++ head/sys/vm/vm_pageout.c Thu May 28 06:52:14 2009 (r192962) @@ -822,12 +822,13 @@ rescan0: } /* - * If the upper level VM system doesn't know anything about - * the page being dirty, we have to check for it again. As - * far as the VM code knows, any partially dirty pages are - * fully dirty. + * If the upper level VM system does not believe that the page + * is fully dirty, but it is mapped for write access, then we + * consult the pmap to see if the page's dirty status should + * be updated. */ - if (m->dirty == 0 && !pmap_is_modified(m)) { + if (m->dirty != VM_PAGE_BITS_ALL && + (m->flags & PG_WRITEABLE) != 0) { /* * Avoid a race condition: Unless write access is * removed from the page, another processor could @@ -841,10 +842,10 @@ rescan0: * to the page, removing all access will be cheaper * overall. */ - if ((m->flags & PG_WRITEABLE) != 0) + if (pmap_is_modified(m)) + vm_page_dirty(m); + else if (m->dirty == 0) pmap_remove_all(m); - } else { - vm_page_dirty(m); } if (m->valid == 0) {