Date: Mon, 2 Nov 2009 17:45:40 +0000 (UTC) From: Alan Cox <alc@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r198812 - head/sys/vm Message-ID: <200911021745.nA2Hjewx064713@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200911021745.nA2Hjewx064713>