Subject: Re: [PATCH net-next] rhashtable: remove insecure_max_entries param

From: Florian Westphal <[email-masked]>
Date: Tue, 25 Apr 2017 13:23:56 +0200

Herbert Xu <[email-masked]> wrote:
> Florian Westphal <[email-masked]> wrote:
> > no users in the tree, insecure_max_entries is always set to
> > ht->p.max_size * 2 in rhtashtable_init().
> > 
> > Replace only spot that uses it with a ht->p.max_size check.
> 
> I'd suggest that as this needs to be computed every time we insert
> an element that you keep the value in struct rhashtable, but as an
> internal value as opposed to a paramter that is set by the user.

What extra cost?

The only change is that ht->nelems has to be right-shifted by one,
I don't think that warrants extra space in struct rhashtable, its
already way too large (I think we can reduce its size further).

Thanks,
Florian