summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2009-11-27 20:24:11 +0000
committeralc <alc@FreeBSD.org>2009-11-27 20:24:11 +0000
commitdcb93e6c955b320316982f0c9532ae0b0f8663ea (patch)
tree9e63971c27f696abb5bbb78d4c260e9f2c8d89a6 /sys/vm
parenta855bffe7835f373e9b80eba00b37a339bac226e (diff)
downloadFreeBSD-src-dcb93e6c955b320316982f0c9532ae0b0f8663ea.zip
FreeBSD-src-dcb93e6c955b320316982f0c9532ae0b0f8663ea.tar.gz
Simplify the invocation of vm_fault(). Specifically, eliminate the flag
VM_FAULT_DIRTY. The information provided by this flag can be trivially inferred by vm_fault(). Discussed with: kib
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/vm_fault.c19
-rw-r--r--sys/vm/vm_map.h1
2 files changed, 11 insertions, 9 deletions
diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c
index 6a261c4..0896cba 100644
--- a/sys/vm/vm_fault.c
+++ b/sys/vm/vm_fault.c
@@ -857,19 +857,12 @@ vnode_locked:
vm_object_set_writeable_dirty(fs.object);
/*
- * If the fault is a write, we know that this page is being
- * written NOW so dirty it explicitly to save on
- * pmap_is_modified() calls later.
- *
* If this is a NOSYNC mmap we do not want to set VPO_NOSYNC
* if the page is already dirty to prevent data written with
* the expectation of being synced from not being synced.
* Likewise if this entry does not request NOSYNC then make
* sure the page isn't marked NOSYNC. Applications sharing
* data should use the same flags to avoid ping ponging.
- *
- * Also tell the backing pager, if any, that it should remove
- * any swap backing since the page is now dirty.
*/
if (fs.entry->eflags & MAP_ENTRY_NOSYNC) {
if (fs.m->dirty == 0)
@@ -877,7 +870,17 @@ vnode_locked:
} else {
fs.m->oflags &= ~VPO_NOSYNC;
}
- if (fault_flags & VM_FAULT_DIRTY) {
+
+ /*
+ * If the fault is a write, we know that this page is being
+ * written NOW so dirty it explicitly to save on
+ * pmap_is_modified() calls later.
+ *
+ * Also tell the backing pager, if any, that it should remove
+ * any swap backing since the page is now dirty.
+ */
+ if ((fault_type & VM_PROT_WRITE) != 0 &&
+ (fault_flags & VM_FAULT_CHANGE_WIRING) == 0) {
vm_page_dirty(fs.m);
vm_pager_page_unswapped(fs.m);
}
diff --git a/sys/vm/vm_map.h b/sys/vm/vm_map.h
index dbf2c67..9630845 100644
--- a/sys/vm/vm_map.h
+++ b/sys/vm/vm_map.h
@@ -319,7 +319,6 @@ long vmspace_wired_count(struct vmspace *vmspace);
*/
#define VM_FAULT_NORMAL 0 /* Nothing special */
#define VM_FAULT_CHANGE_WIRING 1 /* Change the wiring as appropriate */
-#define VM_FAULT_DIRTY 8 /* Dirty the page */
/*
* The following "find_space" options are supported by vm_map_find()
OpenPOWER on IntegriCloud