public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] selftests/sched_ext: Fix the incorrect logic validation
@ 2026-03-02  6:48 Feng Yang
  2026-03-02  7:47 ` Andrea Righi
  0 siblings, 1 reply; 5+ messages in thread
From: Feng Yang @ 2026-03-02  6:48 UTC (permalink / raw)
  To: tj, void, arighi, changwoo, shuah
  Cc: sched-ext, linux-kselftest, linux-kernel

From: Feng Yang <yangfeng@kylinos.cn>

When __COMPAT_scx_bpf_pick_idle_cpu_node selects an idle CPU,
it reports that the CPU should be marked as busy.

Fixes: 5ae5161820e5 ("selftests/sched_ext: Add NUMA-aware scheduler test")
Signed-off-by: Feng Yang <yangfeng@kylinos.cn>
---
 tools/testing/selftests/sched_ext/numa.bpf.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/testing/selftests/sched_ext/numa.bpf.c b/tools/testing/selftests/sched_ext/numa.bpf.c
index a79d86ed54a1..98423628b05c 100644
--- a/tools/testing/selftests/sched_ext/numa.bpf.c
+++ b/tools/testing/selftests/sched_ext/numa.bpf.c
@@ -44,12 +44,12 @@ s32 BPF_STRUCT_OPS(numa_select_cpu,
 	 */
 	cpu = __COMPAT_scx_bpf_pick_idle_cpu_node(p->cpus_ptr, node,
 					__COMPAT_SCX_PICK_IDLE_IN_NODE);
-	if (cpu < 0)
+	if (cpu < 0) {
 		cpu = __COMPAT_scx_bpf_pick_any_cpu_node(p->cpus_ptr, node,
 						__COMPAT_SCX_PICK_IDLE_IN_NODE);
-
-	if (is_cpu_idle(cpu, node))
-		scx_bpf_error("CPU %d should be marked as busy", cpu);
+		if (is_cpu_idle(cpu, node))
+			scx_bpf_error("CPU %d should be marked as busy", cpu);
+	}
 
 	if (__COMPAT_scx_bpf_cpu_node(cpu) != node)
 		scx_bpf_error("CPU %d should be in node %d", cpu, node);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-03-03  2:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-02  6:48 [PATCH] selftests/sched_ext: Fix the incorrect logic validation Feng Yang
2026-03-02  7:47 ` Andrea Righi
2026-03-02  8:41   ` Feng Yang
2026-03-02 15:18     ` Andrea Righi
2026-03-03  2:31       ` Feng Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox