Commit 95b87369 authored by Zhang Qiao's avatar Zhang Qiao Committed by Tejun Heo

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: default avatarZhang Qiao <zhangqiao22@huawei.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent efe231d9
...@@ -3074,22 +3074,13 @@ static s32 scx_select_cpu_dfl(struct task_struct *p, s32 prev_cpu, ...@@ -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. * there is an idle core elsewhere on the system.
*/ */
cpu = smp_processor_id(); 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) && !cpumask_empty(idle_masks.cpu) && !(current->flags & PF_EXITING) &&
cpu_rq(cpu)->scx.local_dsq.nr == 0) { cpu_rq(cpu)->scx.local_dsq.nr == 0) {
if (cpumask_test_cpu(cpu, p->cpus_ptr)) if (cpumask_test_cpu(cpu, p->cpus_ptr))
goto cpu_found; 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 * If CPU has SMT, any wholly idle CPU is likely a better pick than
* partially idle @prev_cpu. * partially idle @prev_cpu.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment