From 457758d86cbb004bcb7f6c832ad6b8a7d9105b82 Mon Sep 17 00:00:00 2001 From: Stephen Dickey Date: Wed, 6 Apr 2022 21:02:57 -0700 Subject: [PATCH] ANDROID: update is_cpu_allowed hook prototype Vendor module needs access to the task structure through is_cpu_allowed tracehook to better assess whether the chosen cpu can be allowed. Update the existing is_cpu_allowed tracehook to pass the task struct of the task currently being handled. Bug: 228392842 Change-Id: I882b593ccb77da0755e076c7e636db304ee74b42 Signed-off-by: Stephen Dickey --- include/trace/hooks/sched.h | 4 ++-- kernel/sched/core.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/trace/hooks/sched.h b/include/trace/hooks/sched.h index d0d0265cdd76..b5bb3186ac5f 100644 --- a/include/trace/hooks/sched.h +++ b/include/trace/hooks/sched.h @@ -65,8 +65,8 @@ DECLARE_RESTRICTED_HOOK(android_rvh_rto_next_cpu, TP_ARGS(rto_cpu, rto_mask, cpu), 1); DECLARE_RESTRICTED_HOOK(android_rvh_is_cpu_allowed, - TP_PROTO(int cpu, bool *allowed), - TP_ARGS(cpu, allowed), 1); + TP_PROTO(struct task_struct *p, int cpu, bool *allowed), + TP_ARGS(p, cpu, allowed), 1); DECLARE_RESTRICTED_HOOK(android_rvh_get_nohz_timer_target, TP_PROTO(int *cpu, bool *done), diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 630553aaa4b5..0e98ac84d8d1 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -2230,7 +2230,7 @@ static inline bool is_cpu_allowed(struct task_struct *p, int cpu) return cpu_online(cpu); /* check for all cases */ - trace_android_rvh_is_cpu_allowed(cpu, &allowed); + trace_android_rvh_is_cpu_allowed(p, cpu, &allowed); /* Non kernel threads are not allowed during either online or offline. */ if (!(p->flags & PF_KTHREAD))