summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_fault.c
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1995-03-27 02:41:00 +0000
committerdg <dg@FreeBSD.org>1995-03-27 02:41:00 +0000
commiteae6c57cbf72ac4613e2937e3268b88856c3065d (patch)
tree4ce056043274c6b7ed3ed53bdc41cc11f9b2db8d /sys/vm/vm_fault.c
parent7ea938b9c95de482afc457a3e20abe9db91e63f8 (diff)
downloadFreeBSD-src-eae6c57cbf72ac4613e2937e3268b88856c3065d.zip
FreeBSD-src-eae6c57cbf72ac4613e2937e3268b88856c3065d.tar.gz
Explicitly set page dirty if this is a write fault - reduces calls to
pmap_is_modified() later.
Diffstat (limited to 'sys/vm/vm_fault.c')
-rw-r--r--sys/vm/vm_fault.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c
index 9beab2b..df5e4c4 100644
--- a/sys/vm/vm_fault.c
+++ b/sys/vm/vm_fault.c
@@ -66,7 +66,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: vm_fault.c,v 1.19 1995/02/22 09:15:26 davidg Exp $
+ * $Id: vm_fault.c,v 1.20 1995/03/01 23:29:55 davidg Exp $
*/
/*
@@ -806,8 +806,17 @@ RetryCopy:
* won't find us (yet).
*/
- if (prot & VM_PROT_WRITE)
+ if (prot & VM_PROT_WRITE) {
m->flags |= PG_WRITEABLE;
+ /*
+ * If the fault is a write, we know that this page is being
+ * written NOW. This will save on the pmap_is_modified() calls
+ * later.
+ */
+ if (fault_type & VM_PROT_WRITE) {
+ m->dirty = VM_PAGE_BITS_ALL;
+ }
+ }
m->flags |= PG_MAPPED;
pmap_enter(map->pmap, vaddr, VM_PAGE_TO_PHYS(m), prot, wired);
OpenPOWER on IntegriCloud