ANDROID: vendor_hooks: Add hooks for oem percpu-rwsem optimaton
Recently we have discovered many lag issues caused by percpu_rwsem lock-holding tasks not being scheduled for a long time. we need to identify them and provide appropriate scheduling protection in our oem scheduler. To support this, we add one hook below: trace_android_vh_percpu_rwsem_wq_add Bug: 301066838 Change-Id: Id770c1a7978842abfc62d3fa9aeb5ac7a1904972 Signed-off-by: xieliujie <xieliujie@oppo.com>
This commit is contained in:
committed by
Treehugger Robot
parent
5af73be864
commit
5723a22d27
@@ -175,6 +175,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_record_mutex_lock_starttime);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_record_rtmutex_lock_starttime);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_record_rwsem_lock_starttime);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_record_pcpu_rwsem_starttime);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_percpu_rwsem_wq_add);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_commit_creds);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_exit_creds);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_override_creds);
|
||||
|
||||
@@ -18,6 +18,7 @@ struct rt_mutex;
|
||||
struct rt_mutex_base;
|
||||
struct rw_semaphore;
|
||||
struct task_struct;
|
||||
struct percpu_rw_semaphore;
|
||||
|
||||
DECLARE_HOOK(android_vh_mutex_wait_start,
|
||||
TP_PROTO(struct mutex *lock),
|
||||
@@ -102,6 +103,9 @@ DECLARE_HOOK(android_vh_flush_work_wait_finish,
|
||||
DECLARE_HOOK(android_vh_sched_show_task,
|
||||
TP_PROTO(struct task_struct *task),
|
||||
TP_ARGS(task));
|
||||
DECLARE_HOOK(android_vh_percpu_rwsem_wq_add,
|
||||
TP_PROTO(struct percpu_rw_semaphore *sem, bool reader),
|
||||
TP_ARGS(sem, reader));
|
||||
|
||||
struct mutex_waiter;
|
||||
DECLARE_HOOK(android_vh_alter_mutex_list_add,
|
||||
|
||||
@@ -167,6 +167,7 @@ static void percpu_rwsem_wait(struct percpu_rw_semaphore *sem, bool reader)
|
||||
if (wait) {
|
||||
wq_entry.flags |= WQ_FLAG_EXCLUSIVE | reader * WQ_FLAG_CUSTOM;
|
||||
__add_wait_queue_entry_tail(&sem->waiters, &wq_entry);
|
||||
trace_android_vh_percpu_rwsem_wq_add(sem, reader);
|
||||
}
|
||||
spin_unlock_irq(&sem->waiters.lock);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user