Re: [PATCH bpf-next v4 2/2] bpf: htab: Reduce elem_size by 8 bytes for small key sizes
From: T.J. Mercier
Date: Thu Aug 13 2026 - 12:50:22 EST
On Wed, Aug 12, 2026 at 5:22 PM <bot+bpf-ci@xxxxxxxxxx> wrote:
>
> > diff --git a/kernel/bpf/hashtab.c b/kernel/bpf/hashtab.c
> > index fed4b1db8b78b..720766121ea2b 100644
> > --- a/kernel/bpf/hashtab.c
> > +++ b/kernel/bpf/hashtab.c
>
> [ ... ]
>
> > diff --git a/tools/testing/selftests/bpf/progs/map_ptr_kern.c b/tools/testing/selftests/bpf/progs/map_ptr_kern.c
> > index 373c8d17ea557..6bd4cb68c20c1 100644
> > --- a/tools/testing/selftests/bpf/progs/map_ptr_kern.c
> > +++ b/tools/testing/selftests/bpf/progs/map_ptr_kern.c
> > @@ -114,7 +114,7 @@ static inline int check_hash(void)
> > VERIFY(check_default_noinline(&hash->map, map));
> >
> > VERIFY(hash->n_buckets == MAX_ENTRIES);
> > - VERIFY(hash->elem_size == 64);
> > + VERIFY(hash->elem_size == 32);
> >
> > VERIFY(hash->count.counter == 0);
> > VERIFY(bpf_map_sum_elem_count(map) == 0);
>
> Should this expectation change have been split across two commits for
> bisectability? The preceding commit 1066507e33e67 dropped the
> freelist/lru union from struct htab_elem, which moves elem_size to 40,
> but that commit leaves the selftest checking for 64. This means the
> map_ptr selftest fails at 1066507e33e67 and only passes again here
> where elem_size becomes 32.
Yes, it should be 40 in the last patch, and 32 here.