Skip to content

Commit 8a9246d

Browse files
committed
sched/smp: Use the SMP version of the scheduler syscalls
Simplify the scheduler by making CONFIG_SMP=y code in idle_cpu(), __sched_setscheduler() and sched_setaffinity() 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-33-mingo@kernel.org
1 parent 9d9af23 commit 8a9246d

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

kernel/sched/syscalls.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,8 @@ int idle_cpu(int cpu)
209209
if (rq->nr_running)
210210
return 0;
211211

212-
#ifdef CONFIG_SMP
213212
if (rq->ttwu_pending)
214213
return 0;
215-
#endif
216214

217215
return 1;
218216
}
@@ -641,7 +639,6 @@ int __sched_setscheduler(struct task_struct *p,
641639
goto unlock;
642640
}
643641
#endif /* CONFIG_RT_GROUP_SCHED */
644-
#ifdef CONFIG_SMP
645642
if (dl_bandwidth_enabled() && dl_policy(policy) &&
646643
!(attr->sched_flags & SCHED_FLAG_SUGOV)) {
647644
cpumask_t *span = rq->rd->span;
@@ -657,7 +654,6 @@ int __sched_setscheduler(struct task_struct *p,
657654
goto unlock;
658655
}
659656
}
660-
#endif /* CONFIG_SMP */
661657
}
662658

663659
/* Re-check policy now with rq lock held: */
@@ -1239,7 +1235,7 @@ long sched_setaffinity(pid_t pid, const struct cpumask *in_mask)
12391235
user_mask = alloc_user_cpus_ptr(NUMA_NO_NODE);
12401236
if (user_mask) {
12411237
cpumask_copy(user_mask, in_mask);
1242-
} else if (IS_ENABLED(CONFIG_SMP)) {
1238+
} else {
12431239
return -ENOMEM;
12441240
}
12451241

0 commit comments

Comments
 (0)