ANDROID: vendor_hooks: fix rt !move_entity bug while switching to sched_ext

These hooks will do the following works:
when scheduling ext, the move_entity operation must be performed.

Bug: 452826319
Bug: 454747318
Change-Id: I85f89607bc47dc475ddfa878b3b7f90ffd010352
Signed-off-by: Yuxing Wang <wangyuxing@oppo.com>
(cherry picked from commit 6b836537975d54fdd0ed6f711ca325d2c2580bd5)
This commit is contained in:
Yuxing Wang
2025-10-17 12:02:09 +08:00
committed by Hu Xile
parent 59be6c5a26
commit 47baf0c583
3 changed files with 8 additions and 0 deletions
+3
View File
@@ -413,6 +413,9 @@ DECLARE_RESTRICTED_HOOK(android_rvh_set_task_comm,
TP_PROTO(struct task_struct *tsk, bool exec),
TP_ARGS(tsk, exec), 1);
DECLARE_HOOK(android_vh_move_entity,
TP_PROTO(int *move, unsigned int flags),
TP_ARGS(move, flags));
DECLARE_HOOK(android_vh_task_should_scx,
TP_PROTO(int *should_scx, int policy, int prio),
TP_ARGS(should_scx, policy, prio));
+4
View File
@@ -1250,6 +1250,10 @@ void dec_rt_tasks(struct sched_rt_entity *rt_se, struct rt_rq *rt_rq)
*/
static inline bool move_entity(unsigned int flags)
{
int move = 0;
trace_android_vh_move_entity(&move, flags);
if (move)
return true;
if ((flags & (DEQUEUE_SAVE | DEQUEUE_MOVE)) == DEQUEUE_SAVE)
return false;
+1
View File
@@ -106,6 +106,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_remove_entity_load_avg);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_set_cpus_allowed_ptr);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_update_blocked_fair);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_set_task_comm);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_move_entity);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_task_should_scx);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_scx_ops_consider_migration);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_scx_fix_prev_slice);