summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2009-05-28 06:52:14 +0000
committeralc <alc@FreeBSD.org>2009-05-28 06:52:14 +0000
commit6d68011290a6156f9221c2fbc75599f7502907f3 (patch)
tree4395e505315d3bd751672163fadd51d09874d25b /sys/vm
parent10a76e38af8b8b4a2cd78809f3787aed2f3ada08 (diff)
downloadFreeBSD-src-6d68011290a6156f9221c2fbc75599f7502907f3.zip
FreeBSD-src-6d68011290a6156f9221c2fbc75599f7502907f3.tar.gz
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
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/vm_pageout.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c
index a76aaa5..ce790f8 100644
--- a/sys/vm/vm_pageout.c
+++ b/sys/vm/vm_pageout.c
@@ -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) {
OpenPOWER on IntegriCloud