From fddc3c957b2302c9e166c709dedcde09945318e3 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 1 Mar 2020 10:54:18 +0100 Subject: [PATCH] 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. --- Kernel/VM/Region.cpp | 4 +--- 1 file changed, 1 insertion(+), 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::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::clone() if (m_stack) { ASSERT(is_readable()); ASSERT(is_writable()); - ASSERT(!is_shared()); ASSERT(vmobject().is_anonymous()); clone_region->set_stack(true); }