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.
This commit is contained in:
Idan Horowitz 2021-08-06 14:58:28 +03:00 committed by Andreas Kling
parent 3ba2449058
commit d40038a04f
Notes: sideshowbarker 2024-07-18 07:23:29 +09:00
2 changed files with 2 additions and 2 deletions

View file

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

View file

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