* [PATCH bpf-next v2] selftests/bpf: Report the real error from libarena parallel workers
@ 2026-07-23 6:13 Jiayuan Chen
2026-07-24 17:48 ` Emil Tsalapatis
2026-07-28 1:00 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Jiayuan Chen @ 2026-07-23 6:13 UTC (permalink / raw)
To: bpf
Cc: Jiayuan Chen, Andrii Nakryiko, Eduard Zingerman,
Alexei Starovoitov, Daniel Borkmann, Kumar Kartikeya Dwivedi,
Martin KaFai Lau, Song Liu, Yonghong Song, Jiri Olsa,
Emil Tsalapatis, Shuah Khan, Ihor Solodrai, linux-kselftest,
linux-kernel
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.
Skip -EINTR entirely: a worker only returns it once another worker has
already reported the real error, so report and log only the real errors.
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
Signed-off-by: Jiayuan Chen <jiayuan.chen@linux.dev>
---
v1 -> v2:
- hoist the worker_err declaration to the top of the function
- skip -EINTR workers entirely: do not aggregate and do not log them
- comment/commit message wording fixes
v1: https://lore.kernel.org/bpf/20260722064713.357277-1-jiayuan.chen@linux.dev/
---
.../selftests/bpf/prog_tests/libarena.c | 18 +++++++++++++++++-
1 file changed, 17 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..daade4150af6 100644
--- a/tools/testing/selftests/bpf/prog_tests/libarena.c
+++ b/tools/testing/selftests/bpf/prog_tests/libarena.c
@@ -73,6 +73,7 @@ static int run_libarena_parallel_test_workers(struct libarena *skel,
uint32_t nthreads;
void *thread_ret;
int ret, err = 0;
+ int worker_err;
int i;
for (nthreads = 0; nthreads < UINT_MAX; nthreads++) {
@@ -118,7 +119,22 @@ static int run_libarena_parallel_test_workers(struct libarena *skel,
continue;
}
- err = err ?: (long)thread_ret;
+ worker_err = (long)thread_ret;
+
+ /*
+ * A worker that bails out because another one already gave up
+ * reports -EINTR. It is collateral damage that carries no
+ * information, so skip it entirely: never let it become the
+ * reported error, and don't log it either.
+ */
+ if (!worker_err || worker_err == -EINTR)
+ continue;
+
+ if (!err)
+ err = worker_err;
+
+ fprintf(stdout, "%.*s__%d returned %d\n", (int)prefixlen, name,
+ i, worker_err);
}
free(threads);
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH bpf-next v2] selftests/bpf: Report the real error from libarena parallel workers
2026-07-23 6:13 [PATCH bpf-next v2] selftests/bpf: Report the real error from libarena parallel workers Jiayuan Chen
@ 2026-07-24 17:48 ` Emil Tsalapatis
2026-07-28 1:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Emil Tsalapatis @ 2026-07-24 17:48 UTC (permalink / raw)
To: Jiayuan Chen, bpf
Cc: Andrii Nakryiko, Eduard Zingerman, Alexei Starovoitov,
Daniel Borkmann, Kumar Kartikeya Dwivedi, Martin KaFai Lau,
Song Liu, Yonghong Song, Jiri Olsa, Emil Tsalapatis, Shuah Khan,
Ihor Solodrai, linux-kselftest, linux-kernel
On Thu Jul 23, 2026 at 2:13 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.
>
> Skip -EINTR entirely: a worker only returns it once another worker has
> already reported the real error, so report and log only the real errors.
>
> 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
>
> Signed-off-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Reviewed-by: Emil Tsalapatis <emil@etsalapatis.com>
>
> ---
> v1 -> v2:
> - hoist the worker_err declaration to the top of the function
> - skip -EINTR workers entirely: do not aggregate and do not log them
> - comment/commit message wording fixes
>
> v1: https://lore.kernel.org/bpf/20260722064713.357277-1-jiayuan.chen@linux.dev/
> ---
> .../selftests/bpf/prog_tests/libarena.c | 18 +++++++++++++++++-
> 1 file changed, 17 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..daade4150af6 100644
> --- a/tools/testing/selftests/bpf/prog_tests/libarena.c
> +++ b/tools/testing/selftests/bpf/prog_tests/libarena.c
> @@ -73,6 +73,7 @@ static int run_libarena_parallel_test_workers(struct libarena *skel,
> uint32_t nthreads;
> void *thread_ret;
> int ret, err = 0;
> + int worker_err;
> int i;
>
> for (nthreads = 0; nthreads < UINT_MAX; nthreads++) {
> @@ -118,7 +119,22 @@ static int run_libarena_parallel_test_workers(struct libarena *skel,
> continue;
> }
>
> - err = err ?: (long)thread_ret;
> + worker_err = (long)thread_ret;
> +
> + /*
> + * A worker that bails out because another one already gave up
> + * reports -EINTR. It is collateral damage that carries no
> + * information, so skip it entirely: never let it become the
> + * reported error, and don't log it either.
> + */
> + if (!worker_err || worker_err == -EINTR)
> + continue;
> +
> + if (!err)
> + err = worker_err;
> +
> + fprintf(stdout, "%.*s__%d returned %d\n", (int)prefixlen, name,
> + i, worker_err);
> }
>
> free(threads);
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH bpf-next v2] selftests/bpf: Report the real error from libarena parallel workers
2026-07-23 6:13 [PATCH bpf-next v2] selftests/bpf: Report the real error from libarena parallel workers Jiayuan Chen
2026-07-24 17:48 ` Emil Tsalapatis
@ 2026-07-28 1:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-07-28 1:00 UTC (permalink / raw)
To: Jiayuan Chen
Cc: bpf, andrii, eddyz87, ast, daniel, memxor, martin.lau, song,
yonghong.song, jolsa, emil, shuah, ihor.solodrai, linux-kselftest,
linux-kernel
Hello:
This patch was applied to bpf/bpf-next.git (master)
by Kumar Kartikeya Dwivedi <memxor@gmail.com>:
On Thu, 23 Jul 2026 14:13:37 +0800 you 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
>
> [...]
Here is the summary with links:
- [bpf-next,v2] selftests/bpf: Report the real error from libarena parallel workers
https://git.kernel.org/bpf/bpf-next/c/fdec474c65fd
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-07-28 1:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-23 6:13 [PATCH bpf-next v2] selftests/bpf: Report the real error from libarena parallel workers Jiayuan Chen
2026-07-24 17:48 ` Emil Tsalapatis
2026-07-28 1:00 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox