summaryrefslogtreecommitdiff
path: root/kernel/sched
diff options
context:
space:
mode:
authorZhang Qiao <zhangqiao22@huawei.com>2024-09-26 18:39:49 +0800
committerTejun Heo <tj@kernel.org>2024-09-27 10:23:45 -1000
commit95b873693a0841e02b812e693296a884362fdd51 (patch)
treea2be2f1a1b2f241335541d33fdadf667a5d17930 /kernel/sched
parentefe231d9debf6db812bebb262407c95b21cdb8a2 (diff)
sched_ext: Remove redundant p->nr_cpus_allowed checker
select_rq_task() already checked that 'p->nr_cpus_allowed > 1', 'p->nr_cpus_allowed == 1' checker in scx_select_cpu_dfl() is redundant. Signed-off-by: Zhang Qiao <zhangqiao22@huawei.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/sched')
-rw-r--r--kernel/sched/ext.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
index 0c398ecdb938..3cd7c50a51c5 100644
--- a/kernel/sched/ext.c
+++ b/kernel/sched/ext.c
@@ -3074,22 +3074,13 @@ static s32 scx_select_cpu_dfl(struct task_struct *p, s32 prev_cpu,
* there is an idle core elsewhere on the system.
*/
cpu = smp_processor_id();
- if ((wake_flags & SCX_WAKE_SYNC) && p->nr_cpus_allowed > 1 &&
+ if ((wake_flags & SCX_WAKE_SYNC) &&
!cpumask_empty(idle_masks.cpu) && !(current->flags & PF_EXITING) &&
cpu_rq(cpu)->scx.local_dsq.nr == 0) {
if (cpumask_test_cpu(cpu, p->cpus_ptr))
goto cpu_found;
}
- if (p->nr_cpus_allowed == 1) {
- if (test_and_clear_cpu_idle(prev_cpu)) {
- cpu = prev_cpu;
- goto cpu_found;
- } else {
- return prev_cpu;
- }
- }
-
/*
* If CPU has SMT, any wholly idle CPU is likely a better pick than
* partially idle @prev_cpu.