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
Shaleen Agrawal
parent
f21e6e9178
commit
1085eff98a
@@ -159,3 +159,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_check_preempt_wakeup_ignore);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_replace_next_task_fair);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_build_sched_domains);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_update_topology_flags_workfn);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_sched_balance_rt);
|
||||
|
||||
@@ -244,6 +244,9 @@ DECLARE_RESTRICTED_HOOK(android_rvh_replace_next_task_fair,
|
||||
TP_PROTO(struct rq *rq, struct task_struct **p, struct sched_entity **se,
|
||||
bool *repick, bool simple),
|
||||
TP_ARGS(rq, p, se, repick, simple), 1);
|
||||
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);
|
||||
|
||||
#endif /* _TRACE_HOOK_SCHED_H */
|
||||
/* This part must be outside protection */
|
||||
|
||||
@@ -1571,6 +1571,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)
|
||||
{
|
||||
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
|
||||
* picked for load-balance and preemption/IRQs are still
|
||||
@@ -1578,6 +1580,8 @@ static int balance_rt(struct rq *rq, struct task_struct *p, struct rq_flags *rf)
|
||||
* not yet started the picking loop.
|
||||
*/
|
||||
rq_unpin_lock(rq, rf);
|
||||
trace_android_rvh_sched_balance_rt(rq, p, &done);
|
||||
if (!done)
|
||||
pull_rt_task(rq);
|
||||
rq_repin_lock(rq, rf);
|
||||
}
|
||||
@@ -1720,7 +1724,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
|
||||
* 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 task_struct *p;
|
||||
@@ -1735,6 +1739,7 @@ static struct task_struct *pick_highest_pushable_task(struct rq *rq, int cpu)
|
||||
|
||||
return NULL;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(pick_highest_pushable_task);
|
||||
|
||||
static DEFINE_PER_CPU(cpumask_var_t, local_cpu_mask);
|
||||
|
||||
|
||||
@@ -873,6 +873,7 @@ extern void sched_put_rd(struct root_domain *rd);
|
||||
#ifdef HAVE_RT_PUSH_IPI
|
||||
extern void rto_push_irq_work_func(struct irq_work *work);
|
||||
#endif
|
||||
extern struct task_struct *pick_highest_pushable_task(struct rq *rq, int cpu);
|
||||
#endif /* CONFIG_SMP */
|
||||
|
||||
#ifdef CONFIG_UCLAMP_TASK
|
||||
|
||||
Reference in New Issue
Block a user