[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150319214933.GA11937@gondor.apana.org.au>
Date: Fri, 20 Mar 2015 08:49:33 +1100
From: Herbert Xu <herbert@...dor.apana.org.au>
To: Thomas Graf <tgraf@...g.ch>
Cc: David Miller <davem@...emloft.net>, netdev@...r.kernel.org
Subject: Re: [PATCH net-next v2] rhashtable: Warn if min_size or max_size are
not a power of two
On Thu, Mar 19, 2015 at 09:15:46PM +0000, Thomas Graf wrote:
>
> rht_grow_above_75() checks the old table size:
>
> (!ht->p.max_size || tbl->size < ht->p.max_size);
>
> If you specify max_size = 3, it grows the table to tbl->size = 4.
> This can be avoided if max_size is a power of two.
OK let's fix the test then. The easiest way would be to round
max_size up to the next power of 2.
Cheers,
--
Email: Herbert Xu <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
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