Kernel: Skip TLB flushes while cloning regions in sys$fork()

Since we know for sure that the virtual memory regions in the new
process being created are not being used on any CPU, there's no need
to do TLB flushes for every mapped page.
This commit is contained in:
Andreas Kling 2021-03-03 22:45:18 +01:00
commit a819eb5016
Notes: sideshowbarker 2024-07-18 21:44:38 +09:00
3 changed files with 10 additions and 4 deletions

View file

@ -89,7 +89,7 @@ KResultOr<pid_t> Process::sys$fork(RegisterState& regs)
}
auto& child_region = child->space().add_region(region_clone.release_nonnull());
child_region.map(child->space().page_directory());
child_region.map(child->space().page_directory(), ShouldFlushTLB::No);
if (&region == m_master_tls_region.unsafe_ptr())
child->m_master_tls_region = child_region;