Re: [PATCH bpf-next v2 2/3] selftests/bpf: Test fetching AND/OR/XOR atomics in arena

From: Alexei Starovoitov

Date: Thu Sep 24 2026 - 13:03:25 EST


On Thu, Sep 24, 2026 at 09:03 AM Puranjay Mohan <puranjay@xxxxxxxxxx> wrote:
> -#ifdef __BPF_FEATURE_ATOMIC_MEM_ORDERING
> - __c11_atomic_fetch_and(&and64_value, 0x011ull << 32, memory_order_relaxed);
> - __c11_atomic_fetch_and(&and32_value, 0x011, memory_order_relaxed);
> -#else
> - __sync_fetch_and_and(&and64_value, 0x011ull << 32);
> - __sync_fetch_and_and(&and32_value, 0x011);
> -#endif
> + and64_result = __sync_fetch_and_and(&and64_value, 0x011ull << 32);
> + and32_result = __sync_fetch_and_and(&and32_value, 0x011);
> + /* Discarding the result is what selects the non-fetching insn. */
> + __c11_atomic_fetch_and(&and64_noreturn_value, 0x011ull << 32, memory_order_relaxed);

The 32-bit non-fetching and/or/xor in arena are not tested anymore.
Pls keep them too.