]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
sched/smp: Use the SMP version of try_to_wake_up()
authorIngo Molnar <mingo@kernel.org>
Wed, 28 May 2025 08:09:04 +0000 (10:09 +0200)
committerIngo Molnar <mingo@kernel.org>
Fri, 13 Jun 2025 06:47:19 +0000 (08:47 +0200)
Simplify the scheduler by making CONFIG_SMP=y logic within
try_to_wake_up() unconditional.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>
Cc: Juri Lelli <juri.lelli@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Shrikanth Hegde <sshegde@linux.ibm.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Valentin Schneider <vschneid@redhat.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
Link: https://lore.kernel.org/r/20250528080924.2273858-24-mingo@kernel.org
kernel/sched/core.c

index c155ee0bd7a8506380397fa2954d90b45cf511d9..d20fea6a380e8a34bf65ad1f7b41c53d77cab664 100644 (file)
@@ -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);
        }