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.
This commit is contained in:
Idan Horowitz 2021-08-06 14:49:52 +03:00 committed by Andreas Kling
parent 1a08694dfc
commit fbd848e6eb
Notes: sideshowbarker 2024-07-18 07:23:36 +09:00
2 changed files with 2 additions and 2 deletions

View File

@ -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) \

View File

@ -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))