summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_map.c
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2014-05-17 14:35:18 +0000
committeralc <alc@FreeBSD.org>2014-05-17 14:35:18 +0000
commita7358720d694c5ffce1cae23cb86d31cce4ea56a (patch)
tree53dc2f6c2c16fb049aabfee37acceb2afaa4d909 /sys/vm/vm_map.c
parentad5edf36f150331652638cd8026eb8e4424fff12 (diff)
downloadFreeBSD-src-a7358720d694c5ffce1cae23cb86d31cce4ea56a.zip
FreeBSD-src-a7358720d694c5ffce1cae23cb86d31cce4ea56a.tar.gz
MFC r265850
About 9% of the pmap_protect() calls being performed by vm_map_copy_entry() are unnecessary. Eliminate the unnecessary calls.
Diffstat (limited to 'sys/vm/vm_map.c')
-rw-r--r--sys/vm/vm_map.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c
index cc94718..cd070df 100644
--- a/sys/vm/vm_map.c
+++ b/sys/vm/vm_map.c
@@ -3023,7 +3023,8 @@ vm_map_copy_entry(
* If the source entry is marked needs_copy, it is already
* write-protected.
*/
- if ((src_entry->eflags & MAP_ENTRY_NEEDS_COPY) == 0) {
+ if ((src_entry->eflags & MAP_ENTRY_NEEDS_COPY) == 0 &&
+ (src_entry->protection & VM_PROT_WRITE) != 0) {
pmap_protect(src_map->pmap,
src_entry->start,
src_entry->end,
OpenPOWER on IntegriCloud