From: "Emil Tsalapatis" <emil@etsalapatis.com>
To: "Jiayuan Chen" <jiayuan.chen@linux.dev>, <bpf@vger.kernel.org>
Cc: "Andrii Nakryiko" <andrii@kernel.org>,
"Eduard Zingerman" <eddyz87@gmail.com>,
"Alexei Starovoitov" <ast@kernel.org>,
"Daniel Borkmann" <daniel@iogearbox.net>,
"Kumar Kartikeya Dwivedi" <memxor@gmail.com>,
"Martin KaFai Lau" <martin.lau@linux.dev>,
"Song Liu" <song@kernel.org>,
"Yonghong Song" <yonghong.song@linux.dev>,
"Jiri Olsa" <jolsa@kernel.org>,
"Emil Tsalapatis" <emil@etsalapatis.com>,
"Shuah Khan" <shuah@kernel.org>,
"Ihor Solodrai" <ihor.solodrai@linux.dev>,
<linux-kselftest@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH bpf-next] selftests/bpf: Report the real error from libarena parallel workers
Date: Wed, 22 Jul 2026 12:41:23 -0400 [thread overview]
Message-ID: <DK58ZON5P6RO.2LTH6C3PKW2VJ@etsalapatis.com> (raw)
In-Reply-To: <20260722064713.357277-1-jiayuan.chen@linux.dev>
On Wed Jul 22, 2026 at 2:47 AM EDT, Jiayuan Chen wrote:
> Several CI runs failed in the libarena parallel tests with -4 (-EINTR) [1],
> which says nothing about what actually went wrong.
>
> Two workers can fail like this:
>
> worker 1: gives up, e.g. the rendezvous times out, sets test_abort and
> returns its own error (-ETIMEDOUT)
> worker 2: sees test_abort and returns -EINTR
>
> -EINTR only means "someone else already gave up", so it carries no
> information. Which of the two gets reported depends on the order
> pthread_join() collects them, because
>
> err = err ?: (long)thread_ret;
>
> keeps the first non-zero value and drops the rest. When the -EINTR worker
> comes first, the error describing the actual failure is lost.
>
> Let any other error win over -EINTR, and log each worker that returned an
> error.
>
> It is still unclear whether the timeouts come from CI load or from a
> problem in the test itself. Report the error accurately first, so the next
> failure can be diagnosed.
>
> [1]:
> https://github.com/kernel-patches/bpf/actions/runs/29867905253/job/88764463566
> https://github.com/kernel-patches/bpf/actions/runs/29878191901/job/88794845824
Overall change makes sense, a couple things.
I'll also look into the error itself.
>
> Signed-off-by: Jiayuan Chen <jiayuan.chen@linux.dev>
> ---
> .../testing/selftests/bpf/prog_tests/libarena.c | 17 ++++++++++++++++-
> 1 file changed, 16 insertions(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/bpf/prog_tests/libarena.c b/tools/testing/selftests/bpf/prog_tests/libarena.c
> index df7e4b8dc394..65743920ff69 100644
> --- a/tools/testing/selftests/bpf/prog_tests/libarena.c
> +++ b/tools/testing/selftests/bpf/prog_tests/libarena.c
> @@ -112,13 +112,28 @@ static int run_libarena_parallel_test_workers(struct libarena *skel,
>
>
> for (i = 0; i < nthreads; i++) {
> + int worker_err;
> +
Let's hoist this definition up to the top of the function.
> ret = pthread_join(threads[i], &thread_ret);
> if (!ASSERT_OK(ret, "pthread_join")) {
> err = err ?: ret;
> continue;
> }
>
> - err = err ?: (long)thread_ret;
> + worker_err = (long)thread_ret;
> + if (!worker_err)
> + continue;
> +
If we are ignoring -EINTR errors from workers then let's skip the
printing for them altogether, otherwise below we keep printing the
"main" error for every interrupted thread.
> + /*
> + * A worker that bails out because another one already gave up
> + * reports -EINTR. That is collateral damage, so let any other
> + * error win: it tells us what actually went wrong.
Capitalize "it"
> + */
> + if (!err || err == -EINTR)
> + err = worker_err;
> +
> + fprintf(stdout, "%.*s__%d returned %d\n", (int)prefixlen, name,
> + i, worker_err);
> }
>
> free(threads);
prev parent reply other threads:[~2026-07-22 16:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-22 6:47 Jiayuan Chen
2026-07-22 16:41 ` Emil Tsalapatis [this message]
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=DK58ZON5P6RO.2LTH6C3PKW2VJ@etsalapatis.com \
--to=emil@etsalapatis.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=ihor.solodrai@linux.dev \
--cc=jiayuan.chen@linux.dev \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=memxor@gmail.com \
--cc=shuah@kernel.org \
--cc=song@kernel.org \
--cc=yonghong.song@linux.dev \
/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
all inboxes | Powered by JetHome®