Sultan Alsawaf
1864788ce7
uid_sys_stats: Convert uid_lock from a spin lock to rt_mutex
In commit 97f2f8a065cb ("ANDROID: uid_sys_stat: split the global lock
uid_lock to the fine-grained locks for each hlist in hash_table"), the lock
was converted into a spin lock because it was acquired under an RCU read
lock. Since that is no longer the case, convert uid_lock back to rt_mutex
since it is held with preemption disabled for a very long time, creating
system-wide stutters:
# tracer: preemptoff
#
# preemptoff latency trace v1.1.5 on 6.1.75-Sultan
# --------------------------------------------------------------------
# latency: 1624 us, #8492/8492, CPU#5 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:8)
# -----------------
# | task: batterystats-wo-1518 (uid:1000 nice:0 policy:0 rt_prio:0)
# -----------------
# => started at: uid_cputime_show
# => ended at: uid_cputime_show
#
#
# _------=> CPU#
# / _-----=> irqs-off/BH-disabled
# | / _----=> need-resched
# || / _---=> hardirq/softirq
# ||| / _--=> preempt-depth
# |||| / _-=> migrate-disable
# ||||| / delay
# cmd pid |||||| time | caller
# \ / |||||| \ | /
<...>-1518 5...1. 0us : _raw_spin_lock <-uid_cputime_show
...
<...>-1518 5...1. 1625us : _raw_spin_unlock <-uid_cputime_show
<...>-1518 5...1. 1625us : tracer_preempt_on <-uid_cputime_show
<...>-1518 5...1. 1627us : <stack trace>
=> _raw_spin_unlock
=> uid_cputime_show
=> seq_read_iter
=> seq_read
=> proc_reg_read
=> vfs_read
=> __arm64_sys_read
=> invoke_syscall.constprop.0
=> do_el0_svc
=> el0_svc
=> el0t_64_sync_handler
=> el0t_64_sync
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: Helium-Studio <67852324+Helium-Studio@users.noreply.github.com>
2025-10-05 12:24:40 +08:00
..
2022-10-07 11:26:56 +03:00
2022-10-07 11:19:35 +03:00
2023-02-01 00:32:00 +08:00
2022-10-07 11:19:36 +03:00
2022-10-07 11:26:56 +03:00
2021-07-20 16:17:48 +02:00
2021-06-03 08:36:20 +02:00
2024-08-24 08:37:06 +00:00
2022-04-11 08:52:28 +00:00
2023-02-01 00:32:00 +08:00
2022-10-07 11:26:56 +03:00
2023-11-20 10:27:34 +01:00
2024-08-11 18:42:43 +03:00
2021-03-11 10:22:12 +05:30
2021-09-22 11:45:24 +02:00
2022-07-08 09:13:29 +00:00
2022-04-07 11:54:10 +00:00
2025-10-05 12:24:40 +08:00
2022-04-21 14:08:46 +02:00
2022-01-27 09:00:53 +01:00
2022-06-29 08:06:55 +00:00
2022-02-10 13:24:46 +00:00
2022-10-07 11:27:03 +03:00
2023-08-25 09:53:00 +03:00
2024-04-28 10:00:16 +03:00
2022-10-07 11:27:03 +03:00
2023-02-01 00:32:00 +08:00
2025-10-05 12:24:40 +08:00
2022-10-07 11:19:35 +03:00