On a fork allow read-only wired pages to be copy-on-write shared between the
parent and child processes. Previously, we copied these pages even though they are read only. However, the reason for copying them is historical and no longer exists. In recent times, vm_map_protect() has developed the ability to copy pages when write access is added to wired copy-on-write pages. So, in this case, copy-on-write sharing of wired pages is not to be feared. It is not going to lead to copy-on-write faults on wired memory. Reviewed by: kib MFC after: 1 week Sponsored by: EMC / Isilon Storage Division
This commit is contained in:
parent
74a034464e
commit
afaa41f6b8
@ -3024,8 +3024,8 @@ vm_map_copy_entry(
|
||||
if ((dst_entry->eflags|src_entry->eflags) & MAP_ENTRY_IS_SUB_MAP)
|
||||
return;
|
||||
|
||||
if (src_entry->wired_count == 0) {
|
||||
|
||||
if (src_entry->wired_count == 0 ||
|
||||
(src_entry->protection & VM_PROT_WRITE) == 0) {
|
||||
/*
|
||||
* If the source entry is marked needs_copy, it is already
|
||||
* write-protected.
|
||||
@ -3116,9 +3116,9 @@ vm_map_copy_entry(
|
||||
dst_entry->end - dst_entry->start, src_entry->start);
|
||||
} else {
|
||||
/*
|
||||
* Of course, wired down pages can't be set copy-on-write.
|
||||
* Cause wired pages to be copied into the new map by
|
||||
* simulating faults (the new pages are pageable)
|
||||
* We don't want to make writeable wired pages copy-on-write.
|
||||
* Immediately copy these pages into the new map by simulating
|
||||
* page faults. The new pages are pageable.
|
||||
*/
|
||||
vm_fault_copy_entry(dst_map, src_map, dst_entry, src_entry,
|
||||
fork_charge);
|
||||
|
Loading…
x
Reference in New Issue
Block a user