From 9d21c796712d4e1b22e62f79af0a63be166912ab Mon Sep 17 00:00:00 2001 From: Idan Horowitz Date: Sat, 7 Aug 2021 16:06:07 +0300 Subject: [PATCH] Kernel: Disable big process lock for sys$sync This syscall doesn't touch any intra-process shared resources and only calls VirtualFileSystem::sync, which is self-locking. --- Kernel/API/Syscall.h | 2 +- Kernel/Syscalls/sync.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel/API/Syscall.h b/Kernel/API/Syscall.h index 50f75daa06..e62cba8aa8 100644 --- a/Kernel/API/Syscall.h +++ b/Kernel/API/Syscall.h @@ -106,7 +106,7 @@ enum class NeedsBigProcessLock { S(mkdir, NeedsBigProcessLock::Yes) \ S(times, NeedsBigProcessLock::Yes) \ S(utime, NeedsBigProcessLock::Yes) \ - S(sync, NeedsBigProcessLock::Yes) \ + S(sync, NeedsBigProcessLock::No) \ S(ptsname, NeedsBigProcessLock::Yes) \ S(select, NeedsBigProcessLock::Yes) \ S(unlink, NeedsBigProcessLock::Yes) \ diff --git a/Kernel/Syscalls/sync.cpp b/Kernel/Syscalls/sync.cpp index 22174843f0..0e369e6ff8 100644 --- a/Kernel/Syscalls/sync.cpp +++ b/Kernel/Syscalls/sync.cpp @@ -11,7 +11,7 @@ namespace Kernel { KResultOr Process::sys$sync() { - VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this) + VERIFY_NO_PROCESS_BIG_LOCK(this) REQUIRE_PROMISE(stdio); VirtualFileSystem::sync(); return 0;