From: bot+bpf-ci@kernel.org
To: changwoo@igalia.com,ast@kernel.org,daniel@iogearbox.net,andrii@kernel.org,eddyz87@gmail.com,memxor@gmail.com,shuah@kernel.org,emil@etsalapatis.com
Cc: martin.lau@linux.dev,song@kernel.org,yonghong.song@linux.dev,jolsa@kernel.org,ihor.solodrai@linux.dev,david.dai@linux.dev,gavinguo@igalia.com,bpf@vger.kernel.org,sched-ext@lists.linux.dev,linux-kselftest@vger.kernel.org,linux-kernel@vger.kernel.org,changwoo@igalia.com,kernel-dev@igalia.com,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 v2 3/3] selftests/bpf: libarena: Cache the rbtree's leftmost node and count
Date: Wed, 11 Nov 2026 08:07:10 +0000 (UTC) [thread overview]
Message-ID: <1c785d97eaac586357e585c4b711076a0df87052bdb135d346c0327d6972fdfb@mail.kernel.org> (raw)
In-Reply-To: <20261111073416.203153-4-changwoo@igalia.com>
[-- Attachment #1: Type: text/plain, Size: 2465 bytes --]
> selftests/bpf: libarena: Cache the rbtree's leftmost node and count
TL;DR: The three new rbtree lockless helpers in rbtree.h are plain static, not
static inline. They may trigger -Wunused-function under -Werror and break the
whole selftests build. Should they be inline?
> diff --git a/tools/testing/selftests/bpf/libarena/include/libarena/rbtree.h b/tools/testing/selftests/bpf/libarena/include/libarena/rbtree.h
> index 788e25fcd7fd..e34d5a51ae3d 100644
> --- a/tools/testing/selftests/bpf/libarena/include/libarena/rbtree.h
> +++ b/tools/testing/selftests/bpf/libarena/include/libarena/rbtree.h
[ ... ]
> @@ -81,4 +98,37 @@ void rb_node_free(struct rbnode __arena *rbnode);
>
> int rb_integrity_check(struct rbtree __arena *rbtree);
>
> +/*
> + * Lockless reads of the head and the node count. [ ... ]
> + */
> +static struct rbnode __arena *rb_first_lockless(struct rbtree __arena *rbtree)
> +{
> + return READ_ONCE(rbtree->first);
> +}
> +
> +/* -ENOENT if the tree is empty, 0 with the leftmost key in @key otherwise. */
> +static int rb_first_key_lockless(struct rbtree __arena *rbtree, u64 *key)
> +{
[ ... ]
> +static u64 rb_nr_nodes_lockless(struct rbtree __arena *rbtree)
> +{
> + return READ_ONCE(rbtree->nr);
> +}
> +
> #endif /* __BPF__ */
Can these three plain static functions break the libarena build?
src/rbtree.bpf.c includes <libarena/rbtree.h> but calls none of them.
Clang only exempts unused file-scope functions from -Wunused-function when
they are declared inline, since static inline functions are assumed to be
header helpers. A plain static function defined in a header still gets the
warning.
The libarena objects are built with the selftests' BPF_CFLAGS, which include
-Wall -Werror, so this would be expected to fail with something like:
rbtree.h: error: unused function 'rb_first_lockless' [-Werror,-Wunused-function]
and, because the libarena skeletons are prerequisites of the test_progs
build, it would break the whole selftests build rather than only the rbtree
tests.
The other helpers defined in libarena headers use static inline or
static __always_inline. Should these three be declared static inline (or
static __always_inline, as in the earlier revision) as well?
---
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/42982574960
prev parent reply other threads:[~2026-11-11 8:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-11 7:34 [PATCH bpf-next v2 0/3] selftests/bpf: libarena: Add ordered-walk and lockless-peek support to the rbtree Changwoo Min
2026-11-11 7:34 ` [PATCH bpf-next v2 1/3] selftests/bpf: libarena: Order equal rbtree keys FIFO Changwoo Min
2026-11-11 7:34 ` [PATCH bpf-next v2 2/3] selftests/bpf: libarena: Add rb_next() Changwoo Min
2026-11-11 7:34 ` [PATCH bpf-next v2 3/3] selftests/bpf: libarena: Cache the rbtree's leftmost node and count Changwoo Min
2026-11-11 8:07 ` bot+bpf-ci [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=1c785d97eaac586357e585c4b711076a0df87052bdb135d346c0327d6972fdfb@mail.kernel.org \
--to=bot+bpf-ci@kernel.org \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=changwoo@igalia.com \
--cc=daniel@iogearbox.net \
--cc=david.dai@linux.dev \
--cc=eddyz87@gmail.com \
--cc=emil@etsalapatis.com \
--cc=gavinguo@igalia.com \
--cc=ihor.solodrai@linux.dev \
--cc=jolsa@kernel.org \
--cc=kernel-dev@igalia.com \
--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=sched-ext@lists.linux.dev \
--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®