Re: [PATCH bpf-next v3 6/8] selftests/bpf: Refactor lifetimes and test wakeups
From: bot+bpf-ci
Date: Fri Nov 20 2026 - 16:35:10 EST
> selftests/bpf: Refactor lifetimes and test wakeups
TL;DR:
- Commit message says what changed but not what was wrong with the old
lifetimes; maybe split the refactor from the new wakeup subtest
- Test nit: repeated tryjoin plus joined=true pairs could go in one helper
> selftests/bpf: Refactor lifetimes and test wakeups
>
> Use cleanup attributes for skeletons, managers, and file descriptors in
> the ring buffer tests. Pass skeletons and managers explicitly, and stop
> or cancel worker threads before joining them. Preserve the existing
> zero-bound, NULL-callback, and overwrite-map regression cases.
>
> Add edge-triggered readiness coverage that consumes one record per call
> to exercise the wakeup handshake across bounded returns.
>
> Signed-off-by: Tamir Duberstein <tamird@xxxxxxxxxx>
This isn't a bug, but the changelog lists what was changed without saying
what was wrong with the old code.
Could it say what problem the lifetime rework addresses, for example the
poll thread outliving the ring buffer when ringbuf_subtest() returns early?
Also, could the lifetime refactor and the new ringbuf_wakeup subtest go in
separate patches?
[ ... ]
> @@ -323,12 +401,14 @@ static void ringbuf_subtest(void)
[ ... ]
> /* background poll should still be blocked */
> err = pthread_tryjoin_np(thread, (void **)&bg_ret);
> + if (!err)
> + thread_guard.joined = true;
> if (CHECK(err != EBUSY, "try_join", "err %d\n", err))
> - goto cleanup;
> + return;
This isn't a bug, but the same two lines, "if (!err) thread_guard.joined =
true;", follow each of the three pthread_tryjoin_np() calls in
ringbuf_subtest().
cleanup_thread() is only correct if every join site updates joined by hand,
and a later tryjoin without it would make the cleanup call pthread_join()
on an already joined thread.
Could the pthread_tryjoin_np() plus joined = true pairs go through one small
helper that takes the thread_guard, so the state is updated in one place?
---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md
CI run summary: https://github.com/kernel-patches/bpf/actions/runs/44815895103