Files
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:26:56 +03:00
2022-04-07 11:54:10 +00:00
2024-04-28 10:00:16 +03:00