From 1dae6a2e4a9b5579a1720ca95458115845bb75cf Mon Sep 17 00:00:00 2001 From: Idan Horowitz Date: Tue, 4 Apr 2023 14:15:17 +0300 Subject: Kernel: Mark sys$mremap as not needing the big lock All accesses to shared mutable data are already serialized behind the process address space spinlock. --- Kernel/API/Syscall.h | 2 +- Kernel/Syscalls/mmap.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel/API/Syscall.h b/Kernel/API/Syscall.h index 246bcf08ad..ccbaf63212 100644 --- a/Kernel/API/Syscall.h +++ b/Kernel/API/Syscall.h @@ -128,7 +128,7 @@ enum class NeedsBigProcessLock { S(mmap, NeedsBigProcessLock::No) \ S(mount, NeedsBigProcessLock::Yes) \ S(mprotect, NeedsBigProcessLock::No) \ - S(mremap, NeedsBigProcessLock::Yes) \ + S(mremap, NeedsBigProcessLock::No) \ S(msync, NeedsBigProcessLock::Yes) \ S(munmap, NeedsBigProcessLock::No) \ S(open, NeedsBigProcessLock::No) \ diff --git a/Kernel/Syscalls/mmap.cpp b/Kernel/Syscalls/mmap.cpp index 42e56d2edd..b38521176a 100644 --- a/Kernel/Syscalls/mmap.cpp +++ b/Kernel/Syscalls/mmap.cpp @@ -480,7 +480,7 @@ ErrorOr Process::sys$munmap(Userspace addr, size_t size) ErrorOr Process::sys$mremap(Userspace user_params) { - VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this); + VERIFY_NO_PROCESS_BIG_LOCK(this); TRY(require_promise(Pledge::stdio)); auto params = TRY(copy_typed_from_user(user_params)); -- cgit v1.2.3