ANDROID: vendor_hooks: Add hooks for rwsem and mutex

Add hooks to apply oem's optimization of rwsem and mutex

Bug: 182237112
Signed-off-by: xieliujie <xieliujie@oppo.com>
Change-Id: I6332623732e2d6826b8b61087ca74e55393e0c3d
This commit is contained in:
xieliujie
2021-03-09 22:15:47 +08:00
committed by Todd Kjos
parent ec89366c1f
commit 80b4341d05
5 changed files with 21 additions and 1 deletions

View File

@@ -210,9 +210,12 @@ static void __sched
__mutex_add_waiter(struct mutex *lock, struct mutex_waiter *waiter,
struct list_head *list)
{
bool already_on_list = false;
debug_mutex_add_waiter(lock, waiter, current);
list_add_tail(&waiter->list, list);
trace_android_vh_alter_mutex_list_add(lock, waiter, list, &already_on_list);
if (!already_on_list)
list_add_tail(&waiter->list, list);
if (__mutex_waiter_is_first(lock, waiter))
__mutex_set_flag(lock, MUTEX_FLAG_WAITERS);
}
@@ -1280,6 +1283,7 @@ static noinline void __sched __mutex_unlock_slowpath(struct mutex *lock, unsigne
if (owner & MUTEX_FLAG_HANDOFF)
__mutex_handoff(lock, next);
trace_android_vh_mutex_unlock_slowpath(lock);
spin_unlock(&lock->wait_lock);
wake_up_q(&wake_q);