From: bot+bpf-ci@kernel.org
To: wusamuel@google.com,ast@kernel.org,daniel@iogearbox.net,andrii@kernel.org,martin.lau@linux.dev,eddyz87@gmail.com,song@kernel.org,yonghong.song@linux.dev,john.fastabend@gmail.com,kpsingh@kernel.org,sdf@fomichev.me,haoluo@google.com,jolsa@kernel.org,shuah@kernel.org
Cc: wusamuel@google.com,kernel-team@android.com,linux-kernel@vger.kernel.org,bpf@vger.kernel.org,linux-kselftest@vger.kernel.org,ast@kernel.org,andrii@kernel.org,daniel@iogearbox.net,martin.lau@kernel.org,eddyz87@gmail.com,yonghong.song@linux.dev,clm@meta.com,ihor.solodrai@linux.dev
Subject: Re: [PATCH bpf-next v4 1/2] bpf: Add wakeup_source iterator
Date: Thu, 12 Feb 2026 00:19:49 +0000 (UTC) [thread overview]
Message-ID: <957536c0c710b7277d3fbc374ff4299bb38542e54de680aaa16d46e72c503e10@mail.kernel.org> (raw)
In-Reply-To: <20260211235055.239024-2-wusamuel@google.com>
[-- Attachment #1: Type: text/plain, Size: 2097 bytes --]
> diff --git a/kernel/bpf/wakeup_source_iter.c b/kernel/bpf/wakeup_source_iter.c
> new file mode 100644
> index 000000000000..ab83d212a1f9
> --- /dev/null
> +++ b/kernel/bpf/wakeup_source_iter.c
[ ... ]
> +static void wakeup_source_iter_seq_stop(struct seq_file *seq, void *v)
> +{
> + int *srcuidx = seq->private;
> +
> + if (*srcuidx >= 0)
> + wakeup_sources_read_unlock(*srcuidx);
> + *srcuidx = -1;
> +}
Should seq_stop invoke the BPF program with a NULL wakeup_source when
iteration completes? Other BPF iterators follow this pattern:
kernel/bpf/map_iter.c:bpf_map_seq_stop():
if (!v)
(void)__bpf_map_seq_show(seq, v, true);
kernel/bpf/prog_iter.c:bpf_prog_seq_stop():
if (!v)
(void)__bpf_prog_seq_show(seq, v, true);
kernel/bpf/link_iter.c:bpf_link_seq_stop():
if (!v)
(void)__bpf_link_seq_show(seq, v, true);
The __wakeup_source_seq_show() function already accepts the in_stop
parameter but is never called with in_stop=true from seq_stop. This would
allow BPF programs to know when iteration is complete and perform any
finalization (e.g., outputting summary statistics).
> +static int __wakeup_source_seq_show(struct seq_file *seq, void *v, bool in_stop)
> +{
> + struct bpf_iter_meta meta = {
> + .seq = seq,
> + };
> + struct bpf_iter__wakeup_source ctx = {
> + .meta = &meta,
> + .wakeup_source = v,
> + };
> + struct bpf_prog *prog = bpf_iter_get_info(&meta, in_stop);
> +
> + if (prog)
> + return bpf_iter_run_prog(prog, &ctx);
> +
> + return 0;
> +}
[ ... ]
---
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/21927983378
AI-authorship-score: low
AI-authorship-explanation: The code follows standard kernel BPF iterator patterns with no unusual characteristics suggesting AI generation.
issues-found: 1
issue-severity-score: low
issue-severity-explanation: Missing end-of-iteration callback is an API consistency issue, not a crash or security problem.
next prev parent reply other threads:[~2026-02-12 0:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-11 23:50 [PATCH bpf-next v4 0/2] Add wakeup_source iterators Samuel Wu
2026-02-11 23:50 ` [PATCH bpf-next v4 1/2] bpf: Add wakeup_source iterator Samuel Wu
2026-02-12 0:19 ` bot+bpf-ci [this message]
2026-02-12 0:35 ` Samuel Wu
2026-02-11 23:50 ` [PATCH bpf-next v4 2/2] selftests/bpf: Add tests for wakeup_sources Samuel Wu
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=957536c0c710b7277d3fbc374ff4299bb38542e54de680aaa16d46e72c503e10@mail.kernel.org \
--to=bot+bpf-ci@kernel.org \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=clm@meta.com \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=haoluo@google.com \
--cc=ihor.solodrai@linux.dev \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kernel-team@android.com \
--cc=kpsingh@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=sdf@fomichev.me \
--cc=shuah@kernel.org \
--cc=song@kernel.org \
--cc=wusamuel@google.com \
--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®