From: "Alexei Starovoitov" <alexei.starovoitov@gmail.com>
To: "T.J. Mercier" <tjmercier@google.com>, <daniel@iogearbox.net>,
<andrii@kernel.org>, <eddyz87@gmail.com>, <memxor@gmail.com>,
<martin.lau@linux.dev>, <song@kernel.org>,
<yonghong.song@linux.dev>, <jolsa@kernel.org>,
<emil@etsalapatis.com>, <ihor.solodrai@linux.dev>,
<mykyta.yatsenko5@gmail.com>
Cc: <bpf@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH bpf-next v5 2/2] bpf: htab: Reduce elem_size by 8 bytes for small key sizes
Date: Mon, 21 Sep 2026 00:57:45 +0000 [thread overview]
Message-ID: <DLKL4EZY63IU.V6E077SCBT1S@gmail.com> (raw)
In-Reply-To: <20260921002206.184660-3-tjmercier@google.com>
On Sun, Sep 20, 2026 at 05:22 PM T.J. Mercier <tjmercier@google.com> wrote:
> + l = __lookup_elem_raw(htab, head, hash, key, key_size, &n);
> + if (l) {
> + /*
> + * Pairs with smp_wmb() in alloc_htab_elem() to ensure
> + * value/pptr reads happen after key/hash match on
> + * recycled elements.
> + */
> + smp_rmb();
> + return l;
> + }
Is this AI suggestion to add barriers?
I think it should be on the program side.
If users really care then they will add such barriers.
Doing it unconditionally will cost performance for everyone.
Especially on arm64.
If you disagree, please provide ./bench bpf-hashmap-lookup numbers on arm64
to demonstrate that perf is the same.
pw-bot: cr
next prev parent reply other threads:[~2026-09-21 0:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-21 0:22 [PATCH bpf-next v5 0/2] bpf: htab: Reduce memory use of hash maps T.J. Mercier
2026-09-21 0:22 ` [PATCH bpf-next v5 1/2] bpf: htab: Split htab_elem_lru and htab_elem_pcpu off of htab_elem T.J. Mercier
2026-09-21 0:51 ` Alexei Starovoitov
2026-09-21 16:40 ` T.J. Mercier
2026-09-21 0:22 ` [PATCH bpf-next v5 2/2] bpf: htab: Reduce elem_size by 8 bytes for small key sizes T.J. Mercier
2026-09-21 0:57 ` Alexei Starovoitov [this message]
2026-09-21 16:34 ` T.J. Mercier
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=DLKL4EZY63IU.V6E077SCBT1S@gmail.com \
--to=alexei.starovoitov@gmail.com \
--cc=andrii@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=emil@etsalapatis.com \
--cc=ihor.solodrai@linux.dev \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=memxor@gmail.com \
--cc=mykyta.yatsenko5@gmail.com \
--cc=song@kernel.org \
--cc=tjmercier@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®