From: bot+bpf-ci@kernel.org
To: tamird@kernel.org,ast@kernel.org,daniel@iogearbox.net,andrii@kernel.org,eddyz87@gmail.com,memxor@gmail.com,martin.lau@linux.dev,song@kernel.org,yonghong.song@linux.dev,jolsa@kernel.org,emil@etsalapatis.com,shuah@kernel.org,arighi@nvidia.com,xukuohai@huawei.com,andrea.righi@canonical.com,billy@starlabs.sg,void@manifault.com,ihor.solodrai@linux.dev
Cc: bpf@vger.kernel.org,linux-kselftest@vger.kernel.org,linux-kernel@vger.kernel.org,awerner32@gmail.com,zeffron@riotgames.com,andriin@fb.com,tamird@kernel.org,ast@kernel.org,andrii@kernel.org,daniel@iogearbox.net,martin.lau@kernel.org,eddyz87@gmail.com,yonghong.song@linux.dev,mason@kernel.org,ihor.solodrai@linux.dev
Subject: Re: [PATCH bpf-next v3 6/8] selftests/bpf: Refactor lifetimes and test wakeups
Date: Fri, 20 Nov 2026 21:34:50 +0000 (UTC) [thread overview]
Message-ID: <7d0a57117d3a4bac7aab7808335393ef3328333d04b7f67d1aa2f492959e3ff0@mail.kernel.org> (raw)
In-Reply-To: <20261120-bpf-ringbuf-fixes-v3-6-ff7ca15d6c37@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 2206 bytes --]
> 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@kernel.org>
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
next prev parent reply other threads:[~2026-11-20 21:34 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-20 20:33 [PATCH bpf-next v3 0/8] bpf: Fix ring buffers and add a libbpf iterator Tamir Duberstein
2026-11-20 20:33 ` [PATCH bpf-next v3 1/8] bpf: user_ringbuf: Handle position wrap Tamir Duberstein
2026-11-20 20:33 ` [PATCH bpf-next v3 2/8] libbpf: ringbuf: Use compiler atomics Tamir Duberstein
2026-11-20 21:34 ` bot+bpf-ci
2026-11-20 20:33 ` [PATCH bpf-next v3 3/8] libbpf: ringbuf: Prevent missed wakeups Tamir Duberstein
2026-11-20 20:33 ` [PATCH bpf-next v3 4/8] libbpf: ringbuf: Add a caller-owned iterator Tamir Duberstein
2026-11-20 21:34 ` bot+bpf-ci
2026-11-20 20:33 ` [PATCH bpf-next v3 5/8] libbpf: ringbuf: Simplify iterator implementation Tamir Duberstein
2026-11-20 20:33 ` [PATCH bpf-next v3 6/8] selftests/bpf: Refactor lifetimes and test wakeups Tamir Duberstein
2026-11-20 21:34 ` bot+bpf-ci [this message]
2026-11-20 20:33 ` [PATCH bpf-next v3 7/8] selftests/bpf: Verify ringbuf callback semantics Tamir Duberstein
2026-11-20 20:33 ` [PATCH bpf-next v3 8/8] selftests/bpf: Test caller-owned ring iterators Tamir Duberstein
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=7d0a57117d3a4bac7aab7808335393ef3328333d04b7f67d1aa2f492959e3ff0@mail.kernel.org \
--to=bot+bpf-ci@kernel.org \
--cc=andrea.righi@canonical.com \
--cc=andrii@kernel.org \
--cc=andriin@fb.com \
--cc=arighi@nvidia.com \
--cc=ast@kernel.org \
--cc=awerner32@gmail.com \
--cc=billy@starlabs.sg \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=emil@etsalapatis.com \
--cc=ihor.solodrai@linux.dev \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=martin.lau@kernel.org \
--cc=martin.lau@linux.dev \
--cc=mason@kernel.org \
--cc=memxor@gmail.com \
--cc=shuah@kernel.org \
--cc=song@kernel.org \
--cc=tamird@kernel.org \
--cc=void@manifault.com \
--cc=xukuohai@huawei.com \
--cc=yonghong.song@linux.dev \
--cc=zeffron@riotgames.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
all inboxes | Powered by JetHome®