Re: [PATCH bpf-next v7 4/9] selftests/bpf: Move READ_ONCE/WRITE_ONCE macros to bpf_experimental.h

Kumar Kartikeya Dwivedi
2026-04-12T19:34:25Z

On Sun, 12 Apr 2026 at 19:45, Emil Tsalapatis <emil@etsalapatis.com> wrote:
>
> The WRITE_ONCE macro is identically defined both in bpf_atomic.h
> and in bpf_arena_common.h. Deduplicate the definitions by moving
> the macro to the commonly used bpf_experimental.h header. Also
> move the READ_ONCE macro to the same file for uniformity.
>

The right header for these is bpf_atomic.h, not bpf_experimental.h. We
want volatile loads to be shipped with bpf_atomic.h and all other
atomic primitives.
https://lore.kernel.org/bpf/CAP01T754eOs2DCjMmkK=CppEwfk5EX84tc70ZqS0_OxTfgxE=w@mail.gmail.com

> Signed-off-by: Emil Tsalapatis <emil@etsalapatis.com>
> Acked-by: Song Liu <song@kernel.org>
> ---
> …