Prechádzať zdrojové kódy

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.
Andreas Kling 5 rokov pred
rodič
commit
fddc3c957b
1 zmenil súbory, kde vykonal 1 pridanie a 3 odobranie
  1. 1 3
      Kernel/VM/Region.cpp

+ 1 - 3
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);
     }