diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2013-09-21 10:01:28 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2013-09-21 10:01:28 +0000 |
commit | c980a7fdce027a2aa8c25e7eb949e3ce2eaabffe (patch) | |
tree | 78d11623039a77c926090c9e79eac40b85addd76 /sys/uvm | |
parent | 6a79d370899533e405d494f662cf3fa2ed3aa388 (diff) |
Don't invoke pmap_copy() on map holes.
Diffstat (limited to 'sys/uvm')
-rw-r--r-- | sys/uvm/uvm_map.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/sys/uvm/uvm_map.c b/sys/uvm/uvm_map.c index af0aa631469..949fbe4f081 100644 --- a/sys/uvm/uvm_map.c +++ b/sys/uvm/uvm_map.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_map.c,v 1.162 2013/05/30 15:17:59 tedu Exp $ */ +/* $OpenBSD: uvm_map.c,v 1.163 2013/09/21 10:01:27 miod Exp $ */ /* $NetBSD: uvm_map.c,v 1.86 2000/11/27 08:40:03 chs Exp $ */ /* @@ -3362,8 +3362,9 @@ uvm_mapent_forkshared(struct vmspace *new_vm, struct vm_map *new_map, * but if it is there it will reduce the number of * page faults in the new proc. */ - pmap_copy(new_map->pmap, old_map->pmap, new_entry->start, - (new_entry->end - new_entry->start), new_entry->start); + if (!UVM_ET_ISHOLE(new_entry)) + pmap_copy(new_map->pmap, old_map->pmap, new_entry->start, + (new_entry->end - new_entry->start), new_entry->start); /* * Update process statistics. @@ -3516,10 +3517,11 @@ uvm_mapent_forkcopy(struct vmspace *new_vm, struct vm_map *new_map, * XXX: need a way to tell if this does anything */ - pmap_copy(new_map->pmap, old_map->pmap, - new_entry->start, - (old_entry->end - old_entry->start), - old_entry->start); + if (!UVM_ET_ISHOLE(new_entry)) + pmap_copy(new_map->pmap, old_map->pmap, + new_entry->start, + (old_entry->end - old_entry->start), + old_entry->start); /* * protect the child's mappings if necessary |