Skip to contentSkip to conversation

sched_ext: idle: Fix return code of scx_select_cpu_dfl()

PATCH Applied Andrea Righi 2 participants 2 messages Mar 26, 2025 Scheduler

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sched_ext: idle: Fix return code of scx_select_cpu_dfl()

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")
---
 kernel/sched/ext_idle.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/ext_idle.c +1 -1
index 52c36a70a3d04..45061b5843806 100644
@@ -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;
 		}
 	}
Signature · 1 line
2.49.0
Applied
#1 lore raw
Quoted 6 lines · Andrea Righi

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")

Applied to sched_ext/for-6.15-fixes.

Thanks.

Signature · 1 line
tejun