1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 09:17:35 +00:00

Kernel: Make sys$times not use the big lock

...and also make the Process tick counters clock_t instead of u32.
It seems harmless to get interrupted in the middle of reading these
counters and reporting slightly fewer ticks in some category.
This commit is contained in:
Andreas Kling 2023-04-03 17:29:14 +02:00
parent b98f537f11
commit 5bc7882b68
3 changed files with 9 additions and 7 deletions

View file

@ -11,8 +11,11 @@ namespace Kernel {
ErrorOr<FlatPtr> Process::sys$times(Userspace<tms*> user_times)
{
VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this);
VERIFY_NO_PROCESS_BIG_LOCK(this);
TRY(require_promise(Pledge::stdio));
// There's no lock here, as it seems harmless to report intermediate values
// as long as each individual counter is intact.
tms times = {};
times.tms_utime = m_ticks_in_user;
times.tms_stime = m_ticks_in_kernel;