ANDROID: sched: Add restricted vendor hooks in CFS scheduler
Add restricted vendor hooks in CFS scheduler class to allow customizations in vendor modules. Bug: 180668820 Change-Id: I69bd90e11220d7607b075a3aa687059deaa60439 Signed-off-by: Pavankumar Kondeti <quic_pkondeti@quicinc.com>
This commit is contained in:
@@ -152,3 +152,5 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_do_sea);
|
|||||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_do_mem_abort);
|
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_do_mem_abort);
|
||||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_do_sp_pc_abort);
|
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_do_sp_pc_abort);
|
||||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_iommu_setup_dma_ops);
|
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_iommu_setup_dma_ops);
|
||||||
|
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_pick_next_entity);
|
||||||
|
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_check_preempt_wakeup);
|
||||||
|
@@ -242,6 +242,16 @@ DECLARE_RESTRICTED_HOOK(android_rvh_dequeue_task_idle,
|
|||||||
TP_PROTO(struct task_struct *p),
|
TP_PROTO(struct task_struct *p),
|
||||||
TP_ARGS(p), 1);
|
TP_ARGS(p), 1);
|
||||||
|
|
||||||
|
struct cfs_rq;
|
||||||
|
DECLARE_RESTRICTED_HOOK(android_rvh_pick_next_entity,
|
||||||
|
TP_PROTO(struct cfs_rq *cfs_rq, struct sched_entity *curr,
|
||||||
|
struct sched_entity **se),
|
||||||
|
TP_ARGS(cfs_rq, curr, se), 1);
|
||||||
|
|
||||||
|
DECLARE_RESTRICTED_HOOK(android_rvh_check_preempt_wakeup,
|
||||||
|
TP_PROTO(struct rq *rq, struct task_struct *p, bool *preempt),
|
||||||
|
TP_ARGS(rq, p, preempt), 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 */
|
||||||
|
@@ -4443,7 +4443,11 @@ static struct sched_entity *
|
|||||||
pick_next_entity(struct cfs_rq *cfs_rq, struct sched_entity *curr)
|
pick_next_entity(struct cfs_rq *cfs_rq, struct sched_entity *curr)
|
||||||
{
|
{
|
||||||
struct sched_entity *left = __pick_first_entity(cfs_rq);
|
struct sched_entity *left = __pick_first_entity(cfs_rq);
|
||||||
struct sched_entity *se;
|
struct sched_entity *se = NULL;
|
||||||
|
|
||||||
|
trace_android_rvh_pick_next_entity(cfs_rq, curr, &se);
|
||||||
|
if (se)
|
||||||
|
goto done;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If curr is set we have to see if its left of the leftmost entity
|
* If curr is set we have to see if its left of the leftmost entity
|
||||||
@@ -4485,6 +4489,7 @@ pick_next_entity(struct cfs_rq *cfs_rq, struct sched_entity *curr)
|
|||||||
se = cfs_rq->last;
|
se = cfs_rq->last;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
done:
|
||||||
clear_buddies(cfs_rq, se);
|
clear_buddies(cfs_rq, se);
|
||||||
|
|
||||||
return se;
|
return se;
|
||||||
@@ -6993,6 +6998,7 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int wake_
|
|||||||
struct cfs_rq *cfs_rq = task_cfs_rq(curr);
|
struct cfs_rq *cfs_rq = task_cfs_rq(curr);
|
||||||
int scale = cfs_rq->nr_running >= sched_nr_latency;
|
int scale = cfs_rq->nr_running >= sched_nr_latency;
|
||||||
int next_buddy_marked = 0;
|
int next_buddy_marked = 0;
|
||||||
|
bool preempt = false;
|
||||||
|
|
||||||
if (unlikely(se == pse))
|
if (unlikely(se == pse))
|
||||||
return;
|
return;
|
||||||
@@ -7036,6 +7042,9 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int wake_
|
|||||||
if (unlikely(p->policy != SCHED_NORMAL) || !sched_feat(WAKEUP_PREEMPTION))
|
if (unlikely(p->policy != SCHED_NORMAL) || !sched_feat(WAKEUP_PREEMPTION))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
trace_android_rvh_check_preempt_wakeup(rq, p, &preempt);
|
||||||
|
if (preempt)
|
||||||
|
goto preempt;
|
||||||
find_matching_se(&se, &pse);
|
find_matching_se(&se, &pse);
|
||||||
update_curr(cfs_rq_of(se));
|
update_curr(cfs_rq_of(se));
|
||||||
BUG_ON(!pse);
|
BUG_ON(!pse);
|
||||||
|
Reference in New Issue
Block a user