ANDROID: sched: Add restrict vendor hooks for balance_rt()
Add rvh called android_rvh_sched_balance_rt to influence balance_rt() from vendor modules. Bug: 178572414 Change-Id: I555c8ebcf5a3a5d8e3ab881ab9aa507f325285c2 Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
This commit is contained in:

committed by
Quentin Perret

parent
86a65e277a
commit
4b5f345c73
@@ -136,3 +136,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_report_bug);
|
|||||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_em_cpu_energy);
|
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_em_cpu_energy);
|
||||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cpu_up);
|
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cpu_up);
|
||||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cpu_down);
|
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cpu_down);
|
||||||
|
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_sched_balance_rt);
|
||||||
|
@@ -234,6 +234,10 @@ DECLARE_HOOK(android_vh_em_cpu_energy,
|
|||||||
unsigned long *energy),
|
unsigned long *energy),
|
||||||
TP_ARGS(pd, max_util, sum_util, energy));
|
TP_ARGS(pd, max_util, sum_util, energy));
|
||||||
|
|
||||||
|
DECLARE_RESTRICTED_HOOK(android_rvh_sched_balance_rt,
|
||||||
|
TP_PROTO(struct rq *rq, struct task_struct *p, int *done),
|
||||||
|
TP_ARGS(rq, p, done), 1);
|
||||||
|
|
||||||
/* macro versions of hooks are no longer required */
|
/* macro versions of hooks are no longer required */
|
||||||
|
|
||||||
#endif /* _TRACE_HOOK_SCHED_H */
|
#endif /* _TRACE_HOOK_SCHED_H */
|
||||||
|
@@ -1575,6 +1575,8 @@ static void check_preempt_equal_prio(struct rq *rq, struct task_struct *p)
|
|||||||
static int balance_rt(struct rq *rq, struct task_struct *p, struct rq_flags *rf)
|
static int balance_rt(struct rq *rq, struct task_struct *p, struct rq_flags *rf)
|
||||||
{
|
{
|
||||||
if (!on_rt_rq(&p->rt) && need_pull_rt_task(rq, p)) {
|
if (!on_rt_rq(&p->rt) && need_pull_rt_task(rq, p)) {
|
||||||
|
int done = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This is OK, because current is on_cpu, which avoids it being
|
* This is OK, because current is on_cpu, which avoids it being
|
||||||
* picked for load-balance and preemption/IRQs are still
|
* picked for load-balance and preemption/IRQs are still
|
||||||
@@ -1582,7 +1584,9 @@ static int balance_rt(struct rq *rq, struct task_struct *p, struct rq_flags *rf)
|
|||||||
* not yet started the picking loop.
|
* not yet started the picking loop.
|
||||||
*/
|
*/
|
||||||
rq_unpin_lock(rq, rf);
|
rq_unpin_lock(rq, rf);
|
||||||
pull_rt_task(rq);
|
trace_android_rvh_sched_balance_rt(rq, p, &done);
|
||||||
|
if (!done)
|
||||||
|
pull_rt_task(rq);
|
||||||
rq_repin_lock(rq, rf);
|
rq_repin_lock(rq, rf);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1714,7 +1718,7 @@ static int pick_rt_task(struct rq *rq, struct task_struct *p, int cpu)
|
|||||||
* Return the highest pushable rq's task, which is suitable to be executed
|
* Return the highest pushable rq's task, which is suitable to be executed
|
||||||
* on the CPU, NULL otherwise
|
* on the CPU, NULL otherwise
|
||||||
*/
|
*/
|
||||||
static struct task_struct *pick_highest_pushable_task(struct rq *rq, int cpu)
|
struct task_struct *pick_highest_pushable_task(struct rq *rq, int cpu)
|
||||||
{
|
{
|
||||||
struct plist_head *head = &rq->rt.pushable_tasks;
|
struct plist_head *head = &rq->rt.pushable_tasks;
|
||||||
struct task_struct *p;
|
struct task_struct *p;
|
||||||
@@ -1729,6 +1733,7 @@ static struct task_struct *pick_highest_pushable_task(struct rq *rq, int cpu)
|
|||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(pick_highest_pushable_task);
|
||||||
|
|
||||||
static DEFINE_PER_CPU(cpumask_var_t, local_cpu_mask);
|
static DEFINE_PER_CPU(cpumask_var_t, local_cpu_mask);
|
||||||
|
|
||||||
|
@@ -840,6 +840,7 @@ extern void sched_put_rd(struct root_domain *rd);
|
|||||||
#ifdef HAVE_RT_PUSH_IPI
|
#ifdef HAVE_RT_PUSH_IPI
|
||||||
extern void rto_push_irq_work_func(struct irq_work *work);
|
extern void rto_push_irq_work_func(struct irq_work *work);
|
||||||
#endif
|
#endif
|
||||||
|
extern struct task_struct *pick_highest_pushable_task(struct rq *rq, int cpu);
|
||||||
#endif /* CONFIG_SMP */
|
#endif /* CONFIG_SMP */
|
||||||
|
|
||||||
#ifdef CONFIG_UCLAMP_TASK
|
#ifdef CONFIG_UCLAMP_TASK
|
||||||
|
Reference in New Issue
Block a user