From: sashiko-bot@kernel.org
To: "T.J. Mercier" <tjmercier@google.com>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next v2 1/2] bpf: htab: Split htab_elem_lru and htab_elem_pcpu off of htab_elem
Date: Fri, 31 Jul 2026 01:34:59 +0000 [thread overview]
Message-ID: <20260731013500.5D2491F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260731010645.3965783-2-tjmercier@google.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Multi-line comment does not follow the preferred BPF subsystem style.
--
--- Patch [1]: [PATCH bpf-next v2 1/2] bpf: htab: Split htab_elem_lru and htab_elem_pcpu off of htab_elem ---
commit d1965b9ee7c9db7418fb306ab2fc480a8cd067d3
Author: T.J. Mercier <tjmercier@google.com>
bpf: htab: Split htab_elem_lru and htab_elem_pcpu off of htab_elem
This commit eliminates per-element memory overhead by splitting the generic
htab_elem structure into dedicated structures for different map types. It
introduces struct htab_elem_pcpu and struct htab_elem_lru, and updates
struct bpf_htab to track a dynamic key offset for element accesses.
> diff --git a/kernel/bpf/hashtab.c b/kernel/bpf/hashtab.c
> index 9f394e1aa2e85..f54366da459f5 100644
> --- a/kernel/bpf/hashtab.c
> +++ b/kernel/bpf/hashtab.c
> @@ -117,11 +119,27 @@ struct htab_elem {
[ ... ]
> +struct htab_elem_lru {
> + struct htab_node node;
> + struct bpf_lru_node lru_node;
> + u32 hash;
> + char key[] __aligned(8);
> +};
> +
> +/* Only for non-preallocated PCPU maps. Preallocated PCPU maps don't need
> + * ptr_to_pptr, and use htab_elem.
> + */
[Severity: Low]
This isn't a bug, but does this multi-line comment violate the modern BPF
subsystem comment style? The BPF guidelines specify that the opening slash
and star should reside on their own line, with the text beginning on the
following line.
> +struct htab_elem_pcpu {
> + struct htab_node node;
> + void *ptr_to_pptr;
> u32 hash;
> char key[] __aligned(8);
> };
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260731010645.3965783-1-tjmercier@google.com?part=1
next prev parent reply other threads:[~2026-07-31 1:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-31 1:06 [PATCH bpf-next v2 0/2] bpf: htab: Reduce memory use of hash maps T.J. Mercier
2026-07-31 1:06 ` [PATCH bpf-next v2 1/2] bpf: htab: Split htab_elem_lru and htab_elem_pcpu off of htab_elem T.J. Mercier
2026-07-31 1:34 ` sashiko-bot [this message]
2026-07-31 1:06 ` [PATCH bpf-next v2 2/2] bpf: htab: Reduce elem_size by 8 bytes for small key sizes T.J. Mercier
2026-07-31 1:57 ` 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=20260731013500.5D2491F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=tjmercier@google.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.