From: Ingo Molnar Date: Wed, 28 May 2025 08:09:05 +0000 (+0200) Subject: sched/smp: Use the SMP version of __task_needs_rq_lock() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8039addbe5a56e4108b1bea57aa5b3f70750fed9;p=thirdparty%2Fkernel%2Flinux.git sched/smp: Use the SMP version of __task_needs_rq_lock() Simplify the scheduler by making CONFIG_SMP=y code in __task_needs_rq_lock() unconditional. Signed-off-by: Ingo Molnar Acked-by: Peter Zijlstra Cc: Dietmar Eggemann Cc: Juri Lelli Cc: Linus Torvalds Cc: Mel Gorman Cc: Sebastian Andrzej Siewior Cc: Shrikanth Hegde Cc: Steven Rostedt Cc: Valentin Schneider Cc: Vincent Guittot Link: https://lore.kernel.org/r/20250528080924.2273858-25-mingo@kernel.org --- diff --git a/kernel/sched/core.c b/kernel/sched/core.c index d20fea6a380e8..82b7cdb353d88 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -4312,14 +4312,12 @@ static bool __task_needs_rq_lock(struct task_struct *p) if (p->on_rq) return true; -#ifdef CONFIG_SMP /* * Ensure the task has finished __schedule() and will not be referenced * anymore. Again, see try_to_wake_up() for a longer comment. */ smp_rmb(); smp_cond_load_acquire(&p->on_cpu, !VAL); -#endif return false; }