From 9c1e3b8d87d3e25aeb840281c57f671a94b42366 Mon Sep 17 00:00:00 2001 From: alc Date: Mon, 2 Nov 2009 17:45:39 +0000 Subject: Avoid pointless calls to pmap_protect(). Reviewed by: kib --- sys/vm/vm_map.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sys/vm') diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index 06ae63e..414d4e6 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -1914,10 +1914,10 @@ vm_map_protect(vm_map_t map, vm_offset_t start, vm_offset_t end, } /* - * Update physical map if necessary. Worry about copy-on-write - * here. + * When restricting access, update the physical map. Worry + * about copy-on-write here. */ - if (current->protection != old_prot) { + if ((old_prot & ~current->protection) != 0) { #define MASK(entry) (((entry)->eflags & MAP_ENTRY_COW) ? ~VM_PROT_WRITE : \ VM_PROT_ALL) pmap_protect(map->pmap, current->start, -- cgit v1.1