[tip: sched/core] sched/smp: Use the SMP version of task_on_cpu()

From: tip-bot2 for Ingo Molnar
Date: Fri Jun 13 2025 - 03:39:51 EST


The following commit has been merged into the sched/core branch of tip:

Commit-ID: ea100b31eed459ea32d6df4489cf70219fd83a07
Gitweb: https://git.kernel.org/tip/ea100b31eed459ea32d6df4489cf70219fd83a07
Author: Ingo Molnar <mingo@xxxxxxxxxx>
AuthorDate: Wed, 28 May 2025 10:09:20 +02:00
Committer: Ingo Molnar <mingo@xxxxxxxxxx>
CommitterDate: Fri, 13 Jun 2025 08:47:22 +02:00

sched/smp: Use the SMP version of task_on_cpu()

Simplify the scheduler by making CONFIG_SMP=y code in task_on_cpu()
unconditional.

Signed-off-by: Ingo Molnar <mingo@xxxxxxxxxx>
Acked-by: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Dietmar Eggemann <dietmar.eggemann@xxxxxxx>
Cc: Juri Lelli <juri.lelli@xxxxxxxxxx>
Cc: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
Cc: Mel Gorman <mgorman@xxxxxxx>
Cc: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>
Cc: Shrikanth Hegde <sshegde@xxxxxxxxxxxxx>
Cc: Steven Rostedt <rostedt@xxxxxxxxxxx>
Cc: Valentin Schneider <vschneid@xxxxxxxxxx>
Cc: Vincent Guittot <vincent.guittot@xxxxxxxxxx>
Link: https://lore.kernel.org/r/20250528080924.2273858-40-mingo@xxxxxxxxxx
---
kernel/sched/sched.h | 4 ----
1 file changed, 4 deletions(-)

diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index f4bac9f..7490473 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -2238,11 +2238,7 @@ static inline int task_current_donor(struct rq *rq, struct task_struct *p)

static inline int task_on_cpu(struct rq *rq, struct task_struct *p)
{
-#ifdef CONFIG_SMP
return p->on_cpu;
-#else
- return task_current(rq, p);
-#endif
}

static inline int task_on_rq_queued(struct task_struct *p)