[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150318105528.GO17829@casper.infradead.org>
Date: Wed, 18 Mar 2015 10:55:28 +0000
From: Thomas Graf <tgraf@...g.ch>
To: Herbert Xu <herbert@...dor.apana.org.au>
Cc: David Miller <davem@...emloft.net>, netdev@...r.kernel.org,
Eric Dumazet <eric.dumazet@...il.com>
Subject: Re: [v2 PATCH 2/6] rhashtable: Introduce max_size/min_size
On 03/18/15 at 08:01pm, Herbert Xu wrote:
> @@ -935,6 +938,7 @@ int rhashtable_init(struct rhashtable *ht, struct rhashtable_params *params)
>
> params->min_shift = max_t(size_t, params->min_shift,
> ilog2(HASH_MIN_SIZE));
> + params->min_size = max(params->min_size, HASH_MIN_SIZE);
>
> if (params->nelem_hint)
> size = rounded_hashtable_size(params);
The only change I would add on top is to ensure that min_size
and max_size are a power of two as otherwise the table size
used will end up being greater or smaller than specified.
I can do that as a follow-up though.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists