From: Matt Bobrowski <mattbobrowski@google.com>
To: Emil Tsalapatis <emil@etsalapatis.com>
Cc: bpf@vger.kernel.org, ast@kernel.org, andrii@kernel.org,
memxor@gmail.com, daniel@iogearbox.net, eddyz87@gmail.com,
song@kernel.org
Subject: Re: [PATCH bpf-next v8 1/8] selftests/bpf: Add ifdef guard for WRITE_ONCE macro in bpf_atomic.h
Date: Thu, 23 Apr 2026 08:27:04 +0000 [thread overview]
Message-ID: <aenX2EGkEh2qG4k5@google.com> (raw)
In-Reply-To: <20260421165037.4736-2-emil@etsalapatis.com>
On Tue, Apr 21, 2026 at 12:50:30PM -0400, Emil Tsalapatis wrote:
> The WRITE_ONCE macro is identically defined both in bpf_atomic.h
> and in bpf_arena_common.h. However, the bpf_atomic.h definition has no
> ifdef guard. If bpf_atomic.h is included after bpf_arena.common.h,
> compilation fails because of the duplicate definition.
>
> Guard the definiton in bpf_atomic.h with and ifdef to let programs
> include the two headers in any order. Duplicating the definition is
> the simplest solution out of all the alternatives:
>
> - Keeping one of the two existing definitions is not possible because
> both BPF atomics and arena programs need the macro, and the two features
> are independent. Using one should not require the header for the other.
>
> - Factoring out the definition into a new header that only includes it
> is more churn than just duplicating it.
>
> - Factoring out the definition into bpf_experimental.h requires all
> users of WRITE_ONCE to include the header. However, the arena library
> introduced in subsequent commits must be self-contained, while
> bpf_experimental.h is in the base selftests/bpf directory.
>
> Both headers are moved to the arena library in a subsequent patch.
>
> Signed-off-by: Emil Tsalapatis <emil@etsalapatis.com>
Fair enough:
Reviewed-by: Matt Bobrowski <mattbobrowski@google.com>
next prev parent reply other threads:[~2026-04-23 8:27 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-21 16:50 [PATCH bpf-next v8 0/8] Introduce arena library and runtime Emil Tsalapatis
2026-04-21 16:50 ` [PATCH bpf-next v8 1/8] selftests/bpf: Add ifdef guard for WRITE_ONCE macro in bpf_atomic.h Emil Tsalapatis
2026-04-23 8:27 ` Matt Bobrowski [this message]
2026-04-21 16:50 ` [PATCH bpf-next v8 2/8] selftests/bpf: Add basic libarena scaffolding Emil Tsalapatis
2026-04-21 20:08 ` sashiko-bot
2026-04-23 8:24 ` Matt Bobrowski
2026-04-21 16:50 ` [PATCH bpf-next v8 3/8] selftests/bpf: Move arena-related headers into libarena Emil Tsalapatis
2026-04-21 16:50 ` [PATCH bpf-next v8 4/8] selftests/bpf: Add arena ASAN runtime to libarena Emil Tsalapatis
2026-04-21 20:48 ` sashiko-bot
2026-04-21 16:50 ` [PATCH bpf-next v8 5/8] selftests/bpf: Add ASAN support for libarena selftests Emil Tsalapatis
2026-04-21 21:15 ` sashiko-bot
2026-04-21 16:50 ` [PATCH bpf-next v8 6/8] selftests/bpf: Add buddy allocator for libarena Emil Tsalapatis
2026-04-21 17:52 ` bot+bpf-ci
2026-04-21 17:56 ` Emil Tsalapatis
2026-04-21 21:42 ` sashiko-bot
2026-04-23 8:44 ` Matt Bobrowski
2026-04-21 16:50 ` [PATCH bpf-next v8 7/8] selftests/bpf: Add selftests for libarena buddy allocator Emil Tsalapatis
2026-04-21 21:57 ` sashiko-bot
2026-04-21 16:50 ` [PATCH bpf-next v8 8/8] selftests/bpf: Reuse stderr parsing for libarena ASAN tests Emil Tsalapatis
2026-04-21 22:16 ` sashiko-bot
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=aenX2EGkEh2qG4k5@google.com \
--to=mattbobrowski@google.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=emil@etsalapatis.com \
--cc=memxor@gmail.com \
--cc=song@kernel.org \
/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