uid_sys_stats: change to use rt_mutex
authorWei Wang <wvw@google.com>
Mon, 13 Mar 2017 19:22:21 +0000 (12:22 -0700)
committerDanny Wood <danwood76@gmail.com>
Sun, 31 Mar 2019 08:48:11 +0000 (09:48 +0100)
commit9e852762e6d7488db5bb4a7c6494fecc438109b1
treec6a3c02027720bf75e40ede9219c6cf0ea829e20
parent81ad237586e207b8b73281bb35f1b3768285c9a7
uid_sys_stats: change to use rt_mutex

We see this happens multiple times in heavy workload in systrace
and AMS stuck in uid_lock.

Running process:        Process 953
Running thread: android.ui
State:  Uninterruptible Sleep
Start:
1,025.628 ms
Duration:
27,955.949 ms
On CPU:
Running instead:        system_server
Args:
{kernel callsite when blocked:: "uid_procstat_write+0xb8/0x144"}

Changing to rt_mutex can mitigate the priority inversion

Bug: 34991231
Bug: 34193533
Test: on marlin
Change-Id: I28eb3971331cea60b1075740c792ab87d103262c
Signed-off-by: Wei Wang <wvw@google.com>
Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
drivers/misc/uid_sys_stats.c