]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
sched_ext: idle: Fix return code of scx_select_cpu_dfl()
authorAndrea Righi <arighi@nvidia.com>
Wed, 26 Mar 2025 19:18:49 +0000 (20:18 +0100)
committerTejun Heo <tj@kernel.org>
Wed, 26 Mar 2025 20:08:01 +0000 (10:08 -1000)
Return -EBUSY when using %SCX_PICK_IDLE_CORE with scx_select_cpu_dfl()
if a fully idle SMT core cannot be found, instead of falling back to
@prev_cpu, which is not a fully idle SMT core in this case.

Fixes: c414c2171cd9e ("sched_ext: idle: Honor idle flags in the built-in idle selection policy")
Signed-off-by: Andrea Righi <arighi@nvidia.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/sched/ext_idle.c

index 52c36a70a3d044b1453a661cee772620bdcbab03..45061b5843806ca49a5c2529e3d2dae6dcbf25ee 100644 (file)
@@ -544,7 +544,7 @@ s32 scx_select_cpu_dfl(struct task_struct *p, s32 prev_cpu, u64 wake_flags, u64
                 * core.
                 */
                if (flags & SCX_PICK_IDLE_CORE) {
-                       cpu = prev_cpu;
+                       cpu = -EBUSY;
                        goto out_unlock;
                }
        }