svn commit: r198812 - head/sys/vm

Alan Cox alc at FreeBSD.org
Mon Nov 2 17:45:40 UTC 2009


Author: alc
Date: Mon Nov  2 17:45:39 2009
New Revision: 198812
URL: http://svn.freebsd.org/changeset/base/198812

Log:
  Avoid pointless calls to pmap_protect().
  
  Reviewed by:	kib

Modified:
  head/sys/vm/vm_map.c

Modified: head/sys/vm/vm_map.c
==============================================================================
--- head/sys/vm/vm_map.c	Mon Nov  2 16:56:59 2009	(r198811)
+++ head/sys/vm/vm_map.c	Mon Nov  2 17:45:39 2009	(r198812)
@@ -1914,10 +1914,10 @@ vm_map_protect(vm_map_t map, vm_offset_t
 		}
 
 		/*
-		 * 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,


More information about the svn-src-head mailing list