]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
sched/smp: Use the SMP version of __task_needs_rq_lock()
authorIngo Molnar <mingo@kernel.org>
Wed, 28 May 2025 08:09:05 +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 code in
__task_needs_rq_lock() 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-25-mingo@kernel.org
kernel/sched/core.c

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