ANDROID: sched: Add vendor hook for cpu_overutilized
Currently, cpu_overutilized uses the threshold 80% of cpu capacity, Add vendor hook so that vendor could define other values. Bug: 176722431 Signed-off-by: Rick Yiu <rickyiu@google.com> Change-Id: Ic10bd8ebb40f7321cfa10e33ac020e3347ca6550 (cherry picked from commit b199c6e8795791e008cfff6e214676857cd0651c) Signed-off-by: J. Avila <elavila@google.com> (cherry picked from commit f5998fbf2dbbcdda953018d95150b394b02b286b)
This commit is contained in:
parent
53237559ad
commit
87475cbbe1
|
@ -105,6 +105,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_find_energy_efficient_cpu);
|
|||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_sugov_sched_attr);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_set_iowait);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_set_sugov_update);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_cpu_overutilized);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_sched_setaffinity);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_update_cpus_allowed);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_set_skip_swapcache_flags);
|
||||
|
|
|
@ -120,17 +120,25 @@ DECLARE_RESTRICTED_HOOK(android_rvh_migrate_queued_task,
|
|||
DECLARE_RESTRICTED_HOOK(android_rvh_find_energy_efficient_cpu,
|
||||
TP_PROTO(struct task_struct *p, int prev_cpu, int sync, int *new_cpu),
|
||||
TP_ARGS(p, prev_cpu, sync, new_cpu), 1);
|
||||
|
||||
struct sched_attr;
|
||||
DECLARE_HOOK(android_vh_set_sugov_sched_attr,
|
||||
TP_PROTO(struct sched_attr *attr),
|
||||
TP_ARGS(attr));
|
||||
|
||||
DECLARE_RESTRICTED_HOOK(android_rvh_set_iowait,
|
||||
TP_PROTO(struct task_struct *p, struct rq *rq, int *should_iowait_boost),
|
||||
TP_ARGS(p, rq, should_iowait_boost), 1);
|
||||
|
||||
struct sugov_policy;
|
||||
DECLARE_RESTRICTED_HOOK(android_rvh_set_sugov_update,
|
||||
TP_PROTO(struct sugov_policy *sg_policy, unsigned int next_freq, bool *should_update),
|
||||
TP_ARGS(sg_policy, next_freq, should_update), 1);
|
||||
|
||||
DECLARE_RESTRICTED_HOOK(android_rvh_cpu_overutilized,
|
||||
TP_PROTO(int cpu, int *overutilized),
|
||||
TP_ARGS(cpu, overutilized), 1);
|
||||
|
||||
DECLARE_RESTRICTED_HOOK(android_rvh_sched_setaffinity,
|
||||
TP_PROTO(struct task_struct *p, const struct cpumask *in_mask, int *retval),
|
||||
TP_ARGS(p, in_mask, retval), 1);
|
||||
|
|
|
@ -5588,6 +5588,12 @@ static inline unsigned long cpu_util(int cpu);
|
|||
|
||||
static inline bool cpu_overutilized(int cpu)
|
||||
{
|
||||
int overutilized = -1;
|
||||
|
||||
trace_android_rvh_cpu_overutilized(cpu, &overutilized);
|
||||
if (overutilized != -1)
|
||||
return overutilized;
|
||||
|
||||
return !fits_capacity(cpu_util(cpu), capacity_of(cpu));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue