Skip to content

Commit 95b8736

Browse files
Zhang Qiaohtejun
authored andcommitted
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 <[email protected]> Signed-off-by: Tejun Heo <[email protected]>
1 parent efe231d commit 95b8736

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

kernel/sched/ext.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3074,22 +3074,13 @@ static s32 scx_select_cpu_dfl(struct task_struct *p, s32 prev_cpu,
30743074
* there is an idle core elsewhere on the system.
30753075
*/
30763076
cpu = smp_processor_id();
3077-
if ((wake_flags & SCX_WAKE_SYNC) && p->nr_cpus_allowed > 1 &&
3077+
if ((wake_flags & SCX_WAKE_SYNC) &&
30783078
!cpumask_empty(idle_masks.cpu) && !(current->flags & PF_EXITING) &&
30793079
cpu_rq(cpu)->scx.local_dsq.nr == 0) {
30803080
if (cpumask_test_cpu(cpu, p->cpus_ptr))
30813081
goto cpu_found;
30823082
}
30833083

3084-
if (p->nr_cpus_allowed == 1) {
3085-
if (test_and_clear_cpu_idle(prev_cpu)) {
3086-
cpu = prev_cpu;
3087-
goto cpu_found;
3088-
} else {
3089-
return prev_cpu;
3090-
}
3091-
}
3092-
30933084
/*
30943085
* If CPU has SMT, any wholly idle CPU is likely a better pick than
30953086
* partially idle @prev_cpu.

0 commit comments

Comments
 (0)