Changes

1 byte removed ,  11:13, 29 April 2018
m
s/himself/itself/g
Line 1: Line 1:  
== Problem ==
 
== Problem ==
Private anonymous mappings are tricky. They are declared to belong to a single process only and contain ''its'' data, but the Linux kernel optimizes the case when task calls fork() and creates a copy of himself. In this case all private anonymous mappings are "shared" between the parent and the child, but when either of them tries to modify the memory, the respective page is duplicated and the changes occur in the modifier's copy only.
+
Private anonymous mappings are tricky. They are declared to belong to a single process only and contain ''its'' data, but the Linux kernel optimizes the case when task calls fork() and creates a copy of itself. In this case all private anonymous mappings are "shared" between the parent and the child, but when either of them tries to modify the memory, the respective page is duplicated and the changes occur in the modifier's copy only.
    
When taking a dump of a process tree, it's totally correct to copy contents of all the anonymous private mappings independently and restore them in the same way -- just mmap and put the memory in there. But with this approach we effectively do the described memory duplication and thus increase memory usage by checkpointed and restore application.
 
When taking a dump of a process tree, it's totally correct to copy contents of all the anonymous private mappings independently and restore them in the same way -- just mmap and put the memory in there. But with this approach we effectively do the described memory duplication and thus increase memory usage by checkpointed and restore application.
277

edits