ANDROID: sched: add hook to rto_next_cpu

Restricted vendor hook to modify the cpu selected in rto_next_cpu,
which is needed for the implementation of CPU Pause.

Bug: 205164003
Change-Id: I0dc675e54f7f116d538840262fbb0ba6d28246f4
Signed-off-by: Stephen Dickey <quic_dickey@quicinc.com>
Signed-off-by: Ashay Jaiswal <quic_ashayj@quicinc.com>
This commit is contained in:
Stephen Dickey
2021-11-04 15:26:15 -07:00
committed by Todd Kjos
parent 60d2746309
commit 1347ec535a
3 changed files with 8 additions and 0 deletions

View File

@@ -56,6 +56,10 @@ DECLARE_RESTRICTED_HOOK(android_rvh_rtmutex_prepare_setprio,
TP_PROTO(struct task_struct *p, struct task_struct *pi_task),
TP_ARGS(p, pi_task), 1);
DECLARE_RESTRICTED_HOOK(android_rvh_rto_next_cpu,
TP_PROTO(int rto_cpu, struct cpumask *rto_mask, int *cpu),
TP_ARGS(rto_cpu, rto_mask, cpu), 1);
DECLARE_RESTRICTED_HOOK(android_rvh_set_user_nice,
TP_PROTO(struct task_struct *p, long *nice, bool *allowed),
TP_ARGS(p, nice, allowed), 1);

View File

@@ -2305,6 +2305,9 @@ static int rto_next_cpu(struct root_domain *rd)
/* When rto_cpu is -1 this acts like cpumask_first() */
cpu = cpumask_next(rd->rto_cpu, rd->rto_mask);
/* this will be any CPU in the rd->rto_mask, and can be a halted cpu update it */
trace_android_rvh_rto_next_cpu(rd->rto_cpu, rd->rto_mask, &cpu);
rd->rto_cpu = cpu;
if (cpu < nr_cpu_ids)

View File

@@ -71,3 +71,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_place_entity);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_build_perf_domains);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_update_cpu_capacity);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_update_misfit_status);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_rto_next_cpu);