From 2ddba2158c80c846250d8b885c9839131ce1030e Mon Sep 17 00:00:00 2001 From: David Greenman Date: Mon, 27 Mar 1995 02:41:00 +0000 Subject: [PATCH] Explicitly set page dirty if this is a write fault - reduces calls to pmap_is_modified() later. --- sys/vm/vm_fault.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c index 9beab2ba79f6..df5e4c4938ee 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);