From: Ingo Molnar Date: Wed, 28 May 2025 08:09:04 +0000 (+0200) Subject: sched/smp: Use the SMP version of try_to_wake_up() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d0a0a055a58617ac8dd9418f08346e94310f1096;p=thirdparty%2Flinux.git sched/smp: Use the SMP version of try_to_wake_up() Simplify the scheduler by making CONFIG_SMP=y logic within try_to_wake_up() 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-24-mingo@kernel.org --- diff --git a/kernel/sched/core.c b/kernel/sched/core.c index c155ee0bd7a85..d20fea6a380e8 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -4202,7 +4202,6 @@ int try_to_wake_up(struct task_struct *p, unsigned int state, int wake_flags) if (READ_ONCE(p->on_rq) && ttwu_runnable(p, wake_flags)) break; -#ifdef CONFIG_SMP /* * Ensure we load p->on_cpu _after_ p->on_rq, otherwise it would be * possible to, falsely, observe p->on_cpu == 0. @@ -4281,9 +4280,6 @@ int try_to_wake_up(struct task_struct *p, unsigned int state, int wake_flags) psi_ttwu_dequeue(p); set_task_cpu(p, cpu); } -#else /* !CONFIG_SMP: */ - cpu = task_cpu(p); -#endif /* !CONFIG_SMP */ ttwu_queue(p, cpu, wake_flags); }