[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <063D6719AE5E284EB5DD2968C1650D6D1CB039DA@AcuExch.aculab.com>
Date: Wed, 18 Mar 2015 16:51:44 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Thomas Graf' <tgraf@...g.ch>,
Herbert Xu <herbert@...dor.apana.org.au>
CC: David Miller <davem@...emloft.net>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
Eric Dumazet <eric.dumazet@...il.com>
Subject: RE: [v2 PATCH 2/6] rhashtable: Introduce max_size/min_size
From: Thomas Graf
> 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'd just make sure that 'something sensible' happens if they aren't.
You don't really want to error the table creation if some sysctl (etc)
that control the sizes isn't a power of 2.
David
--
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