]> Git Repo - linux.git/commitdiff
sched_ext: Remove redundant p->nr_cpus_allowed checker
authorZhang Qiao <[email protected]>
Thu, 26 Sep 2024 10:39:49 +0000 (18:39 +0800)
committerTejun Heo <[email protected]>
Fri, 27 Sep 2024 20:23:45 +0000 (10:23 -1000)
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]>
kernel/sched/ext.c

index 0c398ecdb9389ff3b0bdf3fbe175151af2805d8e..3cd7c50a51c506e9536b10294c7e6de4a7c003ec 100644 (file)
@@ -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.
This page took 0.063279 seconds and 4 git commands to generate.