From 84b4b9447d682efdab1e83b3cb0cd8a239825226 Mon Sep 17 00:00:00 2001 From: Brian Gianforcaro Date: Sun, 11 Jul 2021 23:25:24 -0700 Subject: [PATCH] Kernel: Move new process registration out of Space spinlock scope There appears to be no reason why the process registration needs to happen under the space spin lock. As the first thread is not started yet it should be completely uncontested, but it's still bad practice. --- Kernel/Syscalls/fork.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel/Syscalls/fork.cpp b/Kernel/Syscalls/fork.cpp index 4619424fc6..b4782d1077 100644 --- a/Kernel/Syscalls/fork.cpp +++ b/Kernel/Syscalls/fork.cpp @@ -108,10 +108,10 @@ KResultOr Process::sys$fork(RegisterState& regs) if (region == m_master_tls_region.unsafe_ptr()) child->m_master_tls_region = child_region; } - - Process::register_new(*child); } + Process::register_new(*child); + PerformanceManager::add_process_created_event(*child); ScopedSpinLock lock(g_scheduler_lock);