From owner-svn-src-all@FreeBSD.ORG Wed Jun 24 04:45:03 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 A68E1106566C; Wed, 24 Jun 2009 04:45:03 +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 8A2D18FC14; Wed, 24 Jun 2009 04:45:03 +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 n5O4j3Io001717; Wed, 24 Jun 2009 04:45:03 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5O4j3p4001714; Wed, 24 Jun 2009 04:45:03 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200906240445.n5O4j3p4001714@svn.freebsd.org> From: Alan Cox Date: Wed, 24 Jun 2009 04:45:03 +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: r194806 - head/sys/vm 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: Wed, 24 Jun 2009 04:45:04 -0000 Author: alc Date: Wed Jun 24 04:45:03 2009 New Revision: 194806 URL: http://svn.freebsd.org/changeset/base/194806 Log: The bits set in a page's dirty mask are a subset of the bits set in its valid mask. Consequently, there is no need to perform a bit-wise and of the page's dirty and valid masks in order to determine which parts of a page are dirty and valid. Eliminate an unnecessary #include. Modified: head/sys/vm/vm_object.c head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Wed Jun 24 02:01:16 2009 (r194805) +++ head/sys/vm/vm_object.c Wed Jun 24 04:45:03 2009 (r194806) @@ -787,7 +787,7 @@ vm_object_page_clean(vm_object_t object, continue; } vm_page_test_dirty(p); - if ((p->dirty & p->valid) == 0) { + if (p->dirty == 0) { if (--scanlimit == 0) break; ++tscan; @@ -874,7 +874,7 @@ again: } vm_page_test_dirty(p); - if ((p->dirty & p->valid) == 0) { + if (p->dirty == 0) { p->oflags &= ~VPO_CLEANCHK; continue; } @@ -947,7 +947,7 @@ vm_object_page_collect_flush(vm_object_t (tp->busy != 0)) break; vm_page_test_dirty(tp); - if ((tp->dirty & tp->valid) == 0) { + if (tp->dirty == 0) { tp->oflags &= ~VPO_CLEANCHK; break; } @@ -971,7 +971,7 @@ vm_object_page_collect_flush(vm_object_t (tp->busy != 0)) break; vm_page_test_dirty(tp); - if ((tp->dirty & tp->valid) == 0) { + if (tp->dirty == 0) { tp->oflags &= ~VPO_CLEANCHK; break; } @@ -999,7 +999,7 @@ vm_object_page_collect_flush(vm_object_t vm_pageout_flush(ma, runlen, pagerflags); for (i = 0; i < runlen; i++) { - if (ma[i]->valid & ma[i]->dirty) { + if (ma[i]->dirty) { pmap_remove_write(ma[i]); ma[i]->oflags |= VPO_CLEANCHK; @@ -1946,7 +1946,7 @@ again: ("vm_object_page_remove: page %p is fictitious", p)); if (clean_only && p->valid) { pmap_remove_write(p); - if (p->valid & p->dirty) + if (p->dirty) continue; } pmap_remove_all(p); Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Wed Jun 24 02:01:16 2009 (r194805) +++ head/sys/vm/vm_pageout.c Wed Jun 24 04:45:03 2009 (r194806) @@ -105,8 +105,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - /* * System initialization */ @@ -350,7 +348,7 @@ more: break; } vm_page_test_dirty(p); - if ((p->dirty & p->valid) == 0 || + if (p->dirty == 0 || p->queue != PQ_INACTIVE || p->wire_count != 0 || /* may be held by buf cache */ p->hold_count != 0) { /* may be undergoing I/O */ @@ -378,7 +376,7 @@ more: break; } vm_page_test_dirty(p); - if ((p->dirty & p->valid) == 0 || + if (p->dirty == 0 || p->queue != PQ_INACTIVE || p->wire_count != 0 || /* may be held by buf cache */ p->hold_count != 0) { /* may be undergoing I/O */