Call pmap_copy() only for map entries which have the backing object

instantiated.

Calling pmap_copy() on non-faulted anonymous memory entries is useless.

Noted and reviewed by:	alc
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
This commit is contained in:
Konstantin Belousov 2017-06-21 18:54:28 +00:00
parent 00de677313
commit 0ec97ffc10
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=320202

View File

@ -3239,6 +3239,10 @@ vm_map_copy_entry(
fake_entry->next = curthread->td_map_def_user;
curthread->td_map_def_user = fake_entry;
}
pmap_copy(dst_map->pmap, src_map->pmap,
dst_entry->start, dst_entry->end - dst_entry->start,
src_entry->start);
} else {
dst_entry->object.vm_object = NULL;
dst_entry->offset = 0;
@ -3248,9 +3252,6 @@ vm_map_copy_entry(
*fork_charge += size;
}
}
pmap_copy(dst_map->pmap, src_map->pmap, dst_entry->start,
dst_entry->end - dst_entry->start, src_entry->start);
} else {
/*
* We don't want to make writeable wired pages copy-on-write.