From d2e452e197cefa7e15652a027ef1d626d2868421 Mon Sep 17 00:00:00 2001 From: John Stultz Date: Tue, 1 Jul 2025 05:20:30 +0000 Subject: [PATCH] ANDROID: Build fixups with PROXY_EXEC v18 + !CONFIG_SMP In doing some testing, I caught a few build issues with different combinations of enabling and disabling CONFIG_SCHED_PROXY_EXEC and CONFIG_SMP after syncing with the v18 of the proxy-exec series. These fixes were not in the v18 series of the patch, but I've included them in my tree for v19. Bug: 427820735 Change-Id: Ice3733219a292f882223f8a505f5339fa4b7583f Signed-off-by: John Stultz --- kernel/sched/core.c | 2 +- kernel/sched/sched.h | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index ce40809920b2..a9bee0cb9abc 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -3899,7 +3899,7 @@ static void do_activate_blocked_waiter(struct rq *target_rq, struct task_struct */ return; } - if (READ_ONCE(p->on_cpu)) { + if (task_on_cpu(task_rq(p), p)) { /* * Its possible this activation is very late, and * we already were woken up and are running on a diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 1963e00548cf..ea33dc8e1bf4 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -2336,7 +2336,7 @@ static inline bool task_is_blocked(struct task_struct *p) static inline int task_on_cpu(struct rq *rq, struct task_struct *p) { #ifdef CONFIG_SMP - return p->on_cpu; + return READ_ONCE(p->on_cpu); #else return task_current(rq, p); #endif @@ -3957,6 +3957,7 @@ void move_queued_task_locked(struct rq *rq, struct rq *dst_rq, struct task_struc int task_is_pushable(struct rq *rq, struct task_struct *p, int cpu); struct task_struct *find_exec_ctx(struct rq *rq, struct task_struct *p); #else /* !CONFIG_SCHED_PROXY_EXEC */ +#ifdef CONFIG_SMP static inline void move_queued_task_locked(struct rq *rq, struct rq *dst_rq, struct task_struct *task) { @@ -3968,7 +3969,7 @@ int task_is_pushable(struct rq *rq, struct task_struct *p, int cpu) { return __task_is_pushable(rq, p, cpu); } - +#endif static inline struct task_struct *find_exec_ctx(struct rq *rq, struct task_struct *p) {