From 159dbf71740077bdb6c4bc0424bb6b3b7e2e6e7e Mon Sep 17 00:00:00 2001 From: liuxudong5 Date: Tue, 15 Aug 2023 11:24:01 +0800 Subject: [PATCH] ANDROID: vendor_hooks: export cgroup_threadgroup_rwsem When the task wakes up from percpu_rwsem_wait, it will enter a long runnable state, which will cause frame loss when the application starts. In order to solve this problem, we need to let the process enter the "vip" queue when it is woken up, so we need to set a flag for the process holding the lock to prove that it is about to hold the lock. Most of this long runnable state occurs in the cgroup_threadgroup_rwsem, so we only care cgroup_threadgroup_rwsem, and cgroup_threadgroup_rwsem should be exported. Finally, if the semaphore is of cgroup_threadgroup_rwsem type and has a flag, then let it join the "vip" queue. Bug: 425550656 Bug: 348699619 Bug: 297785167 Signed-off-by: liuxudong5 Change-Id: I2297dfbc2f2681581241f85a3b4fd59415ea67db (cherry picked from commit d2b35f36dc91f349148f4a6515088081ab7645c8) --- kernel/cgroup/cgroup.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c index 5c0da25ba3fc..cb49a9424491 100644 --- a/kernel/cgroup/cgroup.c +++ b/kernel/cgroup/cgroup.c @@ -115,6 +115,7 @@ static DEFINE_SPINLOCK(cgroup_idr_lock); static DEFINE_SPINLOCK(cgroup_file_kn_lock); DEFINE_PERCPU_RWSEM(cgroup_threadgroup_rwsem); +EXPORT_SYMBOL_GPL(cgroup_threadgroup_rwsem); #define cgroup_assert_mutex_or_rcu_locked() \ RCU_LOCKDEP_WARN(!rcu_read_lock_held() && \