ANDROID: vendor_hooks: bring back the do_sched_yield and setscheduler_uclamp vh

The commit: 04746ed80b ("sched/syscalls: Split out kernel/sched/syscalls.c from kernel/sched/core.c")
moved the syscall code to the syscall.c, and the do_sched_yield and setscheduler_uclamp vh had missed,
so bring back them.

Bug: 376183708

Change-Id: Ie64dbbfd7bf017d10dd03994d437ea7d545af94a
Signed-off-by: Xuewen Yan <xuewen.yan@unisoc.com>
This commit is contained in:
Xuewen Yan
2024-10-29 15:46:57 +08:00
parent 962c205e7e
commit d4acab4311
+6
View File
@@ -16,6 +16,8 @@
#include "sched.h"
#include "autogroup.h"
#include <trace/hooks/sched.h>
static inline int __normal_prio(int policy, int rt_prio, int nice)
{
int prio;
@@ -440,12 +442,14 @@ static void __setscheduler_uclamp(struct task_struct *p,
attr->sched_util_min != -1) {
uclamp_se_set(&p->uclamp_req[UCLAMP_MIN],
attr->sched_util_min, true);
trace_android_vh_setscheduler_uclamp(p, UCLAMP_MIN, attr->sched_util_min);
}
if (attr->sched_flags & SCHED_FLAG_UTIL_CLAMP_MAX &&
attr->sched_util_max != -1) {
uclamp_se_set(&p->uclamp_req[UCLAMP_MAX],
attr->sched_util_max, true);
trace_android_vh_setscheduler_uclamp(p, UCLAMP_MAX, attr->sched_util_max);
}
}
@@ -1403,6 +1407,8 @@ static void do_sched_yield(void)
schedstat_inc(rq->yld_count);
current->sched_class->yield_task(rq);
trace_android_rvh_do_sched_yield(rq);
preempt_disable();
rq_unlock_irq(rq, &rf);
sched_preempt_enable_no_resched();