Skip to content

Commit 7980ad7

Browse files
arighihtejun
authored andcommitted
selftests/sched_ext: Fix exit selftest hang on UP
On single-CPU systems, ops.select_cpu() is never called, causing the EXIT_SELECT_CPU test case to wait indefinitely. Avoid the stall by skipping this specific sub-test when only one CPU is available. Reported-by: Phil Auld <pauld@redhat.com> Fixes: a5db781 ("sched_ext: Add selftests") Signed-off-by: Andrea Righi <arighi@nvidia.com> Reviewed-by: Phil Auld <pauld@redhat.com> Tested-by: Phil Auld <pauld@redhat.com> Signed-off-by: Tejun Heo <tj@kernel.org>
1 parent 33796b9 commit 7980ad7

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

  • tools/testing/selftests/sched_ext

tools/testing/selftests/sched_ext/exit.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ static enum scx_test_status run(void *ctx)
2222
struct bpf_link *link;
2323
char buf[16];
2424

25+
/*
26+
* On single-CPU systems, ops.select_cpu() is never
27+
* invoked, so skip this test to avoid getting stuck
28+
* indefinitely.
29+
*/
30+
if (tc == EXIT_SELECT_CPU && libbpf_num_possible_cpus() == 1)
31+
continue;
32+
2533
skel = exit__open();
2634
SCX_ENUM_INIT(skel);
2735
skel->rodata->exit_point = tc;

0 commit comments

Comments
 (0)