Commit 7980ad7e authored by Andrea Righi's avatar Andrea Righi Committed by Tejun Heo
Browse files

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: default avatarPhil Auld <pauld@redhat.com>
Fixes: a5db7817 ("sched_ext: Add selftests")
Signed-off-by: default avatarAndrea Righi <arighi@nvidia.com>
Reviewed-by: default avatarPhil Auld <pauld@redhat.com>
Tested-by: default avatarPhil Auld <pauld@redhat.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent 33796b91
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -22,6 +22,14 @@ static enum scx_test_status run(void *ctx)
		struct bpf_link *link;
		char buf[16];

		/*
		 * On single-CPU systems, ops.select_cpu() is never
		 * invoked, so skip this test to avoid getting stuck
		 * indefinitely.
		 */
		if (tc == EXIT_SELECT_CPU && libbpf_num_possible_cpus() == 1)
			continue;

		skel = exit__open();
		SCX_ENUM_INIT(skel);
		skel->rodata->exit_point = tc;