Skip to content

Commit 8a9246d

Browse files
author
Ingo Molnar
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 <[email protected]> Acked-by: Peter Zijlstra <[email protected]> Cc: Dietmar Eggemann <[email protected]> Cc: Juri Lelli <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Mel Gorman <[email protected]> Cc: Sebastian Andrzej Siewior <[email protected]> Cc: Shrikanth Hegde <[email protected]> Cc: Steven Rostedt <[email protected]> Cc: Valentin Schneider <[email protected]> Cc: Vincent Guittot <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 9d9af23 commit 8a9246d

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

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)