diff options
author | Idan Horowitz <idan.horowitz@gmail.com> | 2021-08-06 14:58:28 +0300 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-08-06 23:36:12 +0200 |
commit | d40038a04f41bbf7943f9b185644a6d6daaceee6 (patch) | |
tree | 29c32ffc30181fdf58b55e36e6e1558e6395282b /Kernel | |
parent | 3ba2449058b08bcf93a58143d1166b6b1e453859 (diff) | |
download | serenity-d40038a04f41bbf7943f9b185644a6d6daaceee6.zip |
Kernel: Disable big process lock for sys$gettimeofday
This syscall doesn't touch any intra-process shared resources and only
accesses the time via the atomic TimeManagement::now so there's no need
to hold the big lock.
Diffstat (limited to 'Kernel')
-rw-r--r-- | Kernel/API/Syscall.h | 2 | ||||
-rw-r--r-- | Kernel/Syscalls/clock.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/API/Syscall.h b/Kernel/API/Syscall.h index 73c1fbeeee..1236c31595 100644 --- a/Kernel/API/Syscall.h +++ b/Kernel/API/Syscall.h @@ -64,7 +64,7 @@ enum class NeedsBigProcessLock { S(munmap, NeedsBigProcessLock::Yes) \ S(get_dir_entries, NeedsBigProcessLock::Yes) \ S(getcwd, NeedsBigProcessLock::Yes) \ - S(gettimeofday, NeedsBigProcessLock::Yes) \ + S(gettimeofday, NeedsBigProcessLock::No) \ S(gethostname, NeedsBigProcessLock::No) \ S(sethostname, NeedsBigProcessLock::No) \ S(chdir, NeedsBigProcessLock::Yes) \ diff --git a/Kernel/Syscalls/clock.cpp b/Kernel/Syscalls/clock.cpp index 82e6779bcd..19b0dbd855 100644 --- a/Kernel/Syscalls/clock.cpp +++ b/Kernel/Syscalls/clock.cpp @@ -118,7 +118,7 @@ KResultOr<FlatPtr> Process::sys$adjtime(Userspace<const timeval*> user_delta, Us KResultOr<FlatPtr> Process::sys$gettimeofday(Userspace<timeval*> user_tv) { - VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this); + VERIFY_NO_PROCESS_BIG_LOCK(this); REQUIRE_PROMISE(stdio); auto tv = kgettimeofday().to_timeval(); if (!copy_to_user(user_tv, &tv)) |