Re: [PATCH RFC bpf-next v2 00/18] bpf: Introduce resizable hash map

Alexei Starovoitov
2026-04-15T05:13:33Z

On Tue, Apr 14, 2026 at 8:27 PM Herbert Xu <herbert@gondor.apana.org.au> wrote:
>
> On Wed, Apr 08, 2026 at 08:10:05AM -0700, Mykyta Yatsenko wrote:
> >
> > rhashtable: Add rhashtable_walk_enter_from()
>
> Rhashtable walking is strongly discouraged because there is no
> way to provide a consistent walk on a hash table that can be resized
> or rehashed during the walk.
>
> So the question is why do you need to be able to walk through the
> hash table, and do you need consistency guarantees such as walking
> through every entry once and once only?

No need for such guarantees. It's best-effort only.
If the walk skips entries it's fine.
As long as it terminates eventually it's good.
Nothing grabs the locks, so elements are added/deleted in parallel.