Re: [PATCH bpf-next v2 1/2] bpf: htab: Split htab_elem_lru and htab_elem_pcpu off of htab_elem

"T.J. Mercier" <[email protected]> Wed, 5 Aug 2026 15:36:02 -0700
Newsgroups dev.linux.lists.sashiko-reviews,org.kernel.vger.bpf
Message-ID <CABdmKX2iuMORY+_iWDqE62tPk6sVAa9sNC8eMcZT0Js+2CqQqQ@mail.gmail.com>
On Thu, Jul 30, 2026 at 6:35 PM <[email protected]> wrote:
>
> 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 <[email protected]>
>
> 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.

The multi-line comments above and below this one use the same style.
Same for most of the file.