]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
sched/smp: Use the SMP version of sched_exec()
authorIngo Molnar <mingo@kernel.org>
Wed, 28 May 2025 08:09:07 +0000 (10:09 +0200)
committerIngo Molnar <mingo@kernel.org>
Fri, 13 Jun 2025 06:47:20 +0000 (08:47 +0200)
Simplify the scheduler making CONFIG_SMP=y sched_exec()
code 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-27-mingo@kernel.org
include/linux/sched/task.h
kernel/sched/core.c

index ca1db4b92c3244de87033dd481c50c4bb8242a26..c517dbc242f7ce6dc89f306fcc9f1489e414ed79 100644 (file)
@@ -109,11 +109,7 @@ int kernel_wait(pid_t pid, int *stat);
 extern void free_task(struct task_struct *tsk);
 
 /* sched_exec is called by processes performing an exec */
-#ifdef CONFIG_SMP
 extern void sched_exec(void);
-#else
-#define sched_exec()   {}
-#endif
 
 static inline struct task_struct *get_task_struct(struct task_struct *t)
 {
index c108b5c2e1151dc7634389f24853ec0d88ad7172..fa89006e05e97c42141348cd9d7737474c4d28b7 100644 (file)
@@ -5419,8 +5419,6 @@ unsigned int nr_iowait(void)
        return sum;
 }
 
-#ifdef CONFIG_SMP
-
 /*
  * sched_exec - execve() is a valuable balancing opportunity, because at
  * this point the task has the smallest effective memory and cache footprint.
@@ -5444,8 +5442,6 @@ void sched_exec(void)
        stop_one_cpu(task_cpu(p), migration_cpu_stop, &arg);
 }
 
-#endif /* CONFIG_SMP */
-
 DEFINE_PER_CPU(struct kernel_stat, kstat);
 DEFINE_PER_CPU(struct kernel_cpustat, kernel_cpustat);