summaryrefslogtreecommitdiff
path: root/Kernel
diff options
context:
space:
mode:
authorIdan Horowitz <idan.horowitz@gmail.com>2021-08-06 14:49:52 +0300
committerAndreas Kling <kling@serenityos.org>2021-08-06 23:36:12 +0200
commitfbd848e6ebc6a7c5366be55d34881c6fb05da712 (patch)
tree85872d7a0e72a2100655816fba686ab6218d83b9 /Kernel
parent1a08694dfc6a2f0b3ff934ba43f6aab591bc1e41 (diff)
downloadserenity-fbd848e6ebc6a7c5366be55d34881c6fb05da712.zip
Kernel: Disable big process lock for sys$clock_gettime()
This syscall doesn't touch any intra-process shared resources and reads the time via the atomic TimeManagement::current_time, so it doesn't need to hold any lock.
Diffstat (limited to 'Kernel')
-rw-r--r--Kernel/API/Syscall.h2
-rw-r--r--Kernel/Syscalls/clock.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/API/Syscall.h b/Kernel/API/Syscall.h
index f03d876974..f9d6fd6401 100644
--- a/Kernel/API/Syscall.h
+++ b/Kernel/API/Syscall.h
@@ -157,7 +157,7 @@ enum class NeedsBigProcessLock {
S(getrandom, NeedsBigProcessLock::No) \
S(getkeymap, NeedsBigProcessLock::No) \
S(setkeymap, NeedsBigProcessLock::Yes) \
- S(clock_gettime, NeedsBigProcessLock::Yes) \
+ S(clock_gettime, NeedsBigProcessLock::No) \
S(clock_settime, NeedsBigProcessLock::Yes) \
S(clock_nanosleep, NeedsBigProcessLock::Yes) \
S(join_thread, NeedsBigProcessLock::Yes) \
diff --git a/Kernel/Syscalls/clock.cpp b/Kernel/Syscalls/clock.cpp
index 990447ade2..adb3e89f06 100644
--- a/Kernel/Syscalls/clock.cpp
+++ b/Kernel/Syscalls/clock.cpp
@@ -12,7 +12,7 @@ namespace Kernel {
KResultOr<FlatPtr> Process::sys$clock_gettime(clockid_t clock_id, Userspace<timespec*> user_ts)
{
- VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this);
+ VERIFY_NO_PROCESS_BIG_LOCK(this);
REQUIRE_PROMISE(stdio);
if (!TimeManagement::is_valid_clock_id(clock_id))