summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIdan Horowitz <idan.horowitz@gmail.com>2023-04-04 14:15:17 +0300
committerIdan Horowitz <idan.horowitz@gmail.com>2023-04-06 20:30:03 +0300
commit1dae6a2e4a9b5579a1720ca95458115845bb75cf (patch)
tree6d7680baaa15811455e6a60531032e4103119704
parentdb10f201c8dfe9bd1f398a24d417480ec3dd9df6 (diff)
downloadserenity-1dae6a2e4a9b5579a1720ca95458115845bb75cf.zip
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.
-rw-r--r--Kernel/API/Syscall.h2
-rw-r--r--Kernel/Syscalls/mmap.cpp2
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<FlatPtr> Process::sys$munmap(Userspace<void*> addr, size_t size)
ErrorOr<FlatPtr> Process::sys$mremap(Userspace<Syscall::SC_mremap_params const*> 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));