diff options
author | Andreas Kling <kling@serenityos.org> | 2020-03-01 10:54:18 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-03-01 11:23:10 +0100 |
commit | fddc3c957b2302c9e166c709dedcde09945318e3 (patch) | |
tree | 17a1e3fcb7e98b2d980ea4eacd043f6753e75ea1 | |
parent | 88e12f763214b5aa21eef678483c9e815783ac54 (diff) | |
download | serenity-fddc3c957b2302c9e166c709dedcde09945318e3.zip |
Kernel: CoW-clone private inode-backed memory regions on fork()
When forking a process, we now turn all of the private inode-backed
mmap() regions into copy-on-write regions in both the parent and child.
This patch also removes an assertion that becomes irrelevant.
-rw-r--r-- | Kernel/VM/Region.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/Kernel/VM/Region.cpp b/Kernel/VM/Region.cpp index 574c860988..80e0711d67 100644 --- a/Kernel/VM/Region.cpp +++ b/Kernel/VM/Region.cpp @@ -76,8 +76,7 @@ NonnullOwnPtr<Region> Region::clone() { ASSERT(Process::current); - // FIXME: What should we do for privately mapped SharedInodeVMObjects? - if (m_shared || vmobject().is_inode()) { + if (m_shared) { ASSERT(!m_stack); #ifdef MM_DEBUG dbg() << "Region::clone(): Sharing " << name() << " (" << vaddr() << ")"; @@ -100,7 +99,6 @@ NonnullOwnPtr<Region> Region::clone() if (m_stack) { ASSERT(is_readable()); ASSERT(is_writable()); - ASSERT(!is_shared()); ASSERT(vmobject().is_anonymous()); clone_region->set_stack(true); } |