mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-29 05:50:28 +09:00
ANDROID: Sched: Add hooks for scheduler
Add vendors hooks for to facilitate various scheduler value adds. Bug: 200103201 Change-Id: I5d488ae78ce05f81e6c73b69c56128b065647fec Signed-off-by: Shaleen Agrawal <shalagra@codeaurora.org> Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
This commit is contained in:
committed by
Todd Kjos
parent
c0ba33609e
commit
99545883fb
@@ -122,6 +122,10 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_update_cpu_capacity);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_update_misfit_status);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_cpu_cgroup_attach);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_cpu_cgroup_can_attach);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_sched_fork_init);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_ttwu_cond);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_schedule_bug);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_sched_exec);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_map_util_freq);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_em_cpu_energy);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_ftrace_oops_enter);
|
||||
|
||||
@@ -198,6 +198,22 @@ DECLARE_RESTRICTED_HOOK(android_rvh_cpu_cgroup_can_attach,
|
||||
TP_PROTO(struct cgroup_taskset *tset, int *retval),
|
||||
TP_ARGS(tset, retval), 1);
|
||||
|
||||
DECLARE_RESTRICTED_HOOK(android_rvh_sched_fork_init,
|
||||
TP_PROTO(struct task_struct *p),
|
||||
TP_ARGS(p), 1);
|
||||
|
||||
DECLARE_RESTRICTED_HOOK(android_rvh_ttwu_cond,
|
||||
TP_PROTO(bool *cond),
|
||||
TP_ARGS(cond), 1);
|
||||
|
||||
DECLARE_RESTRICTED_HOOK(android_rvh_schedule_bug,
|
||||
TP_PROTO(void *unused),
|
||||
TP_ARGS(unused), 1);
|
||||
|
||||
DECLARE_RESTRICTED_HOOK(android_rvh_sched_exec,
|
||||
TP_PROTO(bool *cond),
|
||||
TP_ARGS(cond), 1);
|
||||
|
||||
DECLARE_HOOK(android_vh_map_util_freq,
|
||||
TP_PROTO(unsigned long util, unsigned long freq,
|
||||
unsigned long cap, unsigned long *next_freq),
|
||||
|
||||
@@ -3775,7 +3775,12 @@ static inline bool ttwu_queue_cond(int cpu, int wake_flags)
|
||||
|
||||
static bool ttwu_queue_wakelist(struct task_struct *p, int cpu, int wake_flags)
|
||||
{
|
||||
if (sched_feat(TTWU_QUEUE) && ttwu_queue_cond(cpu, wake_flags)) {
|
||||
bool cond = false;
|
||||
|
||||
trace_android_rvh_ttwu_cond(&cond);
|
||||
|
||||
if ((sched_feat(TTWU_QUEUE) && ttwu_queue_cond(cpu, wake_flags)) ||
|
||||
cond) {
|
||||
if (WARN_ON_ONCE(cpu == smp_processor_id()))
|
||||
return false;
|
||||
|
||||
@@ -4233,6 +4238,8 @@ static void __sched_fork(unsigned long clone_flags, struct task_struct *p)
|
||||
p->se.cfs_rq = NULL;
|
||||
#endif
|
||||
|
||||
trace_android_rvh_sched_fork_init(p);
|
||||
|
||||
#ifdef CONFIG_SCHEDSTATS
|
||||
/* Even if schedstat is disabled, there should not be garbage */
|
||||
memset(&p->se.statistics, 0, sizeof(p->se.statistics));
|
||||
@@ -5099,6 +5106,11 @@ void sched_exec(void)
|
||||
struct task_struct *p = current;
|
||||
unsigned long flags;
|
||||
int dest_cpu;
|
||||
bool cond = false;
|
||||
|
||||
trace_android_rvh_sched_exec(&cond);
|
||||
if (cond)
|
||||
return;
|
||||
|
||||
raw_spin_lock_irqsave(&p->pi_lock, flags);
|
||||
dest_cpu = p->sched_class->select_task_rq(p, task_cpu(p), WF_EXEC);
|
||||
@@ -5530,6 +5542,8 @@ static noinline void __schedule_bug(struct task_struct *prev)
|
||||
if (panic_on_warn)
|
||||
panic("scheduling while atomic\n");
|
||||
|
||||
trace_android_rvh_schedule_bug(prev);
|
||||
|
||||
dump_stack();
|
||||
add_taint(TAINT_WARN, LOCKDEP_STILL_OK);
|
||||
}
|
||||
@@ -9586,6 +9600,9 @@ void ___might_sleep(const char *file, int line, int preempt_offset)
|
||||
pr_err("Preemption disabled at:");
|
||||
print_ip_sym(KERN_ERR, preempt_disable_ip);
|
||||
}
|
||||
|
||||
trace_android_rvh_schedule_bug(NULL);
|
||||
|
||||
dump_stack();
|
||||
add_taint(TAINT_WARN, LOCKDEP_STILL_OK);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user