From: Phil Auld <pauld@redhat.com>
To: Andrea Righi <arighi@nvidia.com>
Cc: Tejun Heo <tj@kernel.org>, David Vernet <void@manifault.com>,
Changwoo Min <changwoo@igalia.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] selftests/sched_ext: Fix exit selftest hang on UP
Date: Tue, 1 Jul 2025 09:00:22 -0400 [thread overview]
Message-ID: <20250701130022.GA26180@pauld.westford.csb> (raw)
In-Reply-To: <20250701060845.134026-1-arighi@nvidia.com>
On Tue, Jul 01, 2025 at 08:08:45AM +0200 Andrea Righi wrote:
> 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: a5db7817af780 ("sched_ext: Add selftests")
> Signed-off-by: Andrea Righi <arighi@nvidia.com>
Thanks Andrea! You beat me to it. I didn't know that libbpf
call existed :)
Reviewed-by: Phil Auld <pauld@redhat.com>
and
Tested-by: Phil Auld <pauld@redhat.com>
Cheers,
Phil
> ---
> tools/testing/selftests/sched_ext/exit.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/tools/testing/selftests/sched_ext/exit.c b/tools/testing/selftests/sched_ext/exit.c
> index 9451782689de1..ee25824b1cbe6 100644
> --- a/tools/testing/selftests/sched_ext/exit.c
> +++ b/tools/testing/selftests/sched_ext/exit.c
> @@ -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;
> --
> 2.50.0
>
--
next prev parent reply other threads:[~2025-07-01 13:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-01 6:08 [PATCH] selftests/sched_ext: Fix exit selftest hang on UP Andrea Righi
2025-07-01 13:00 ` Phil Auld [this message]
2025-07-03 16:45 ` Tejun Heo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250701130022.GA26180@pauld.westford.csb \
--to=pauld@redhat.com \
--cc=arighi@nvidia.com \
--cc=changwoo@igalia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@kernel.org \
--cc=void@manifault.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox