[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170724031840.GA25786@gondor.apana.org.au>
Date: Mon, 24 Jul 2017 11:18:41 +0800
From: Herbert Xu <herbert@...dor.apana.org.au>
To: Phil Sutter <phil@....cc>
Cc: Thomas Graf <tgraf@...g.ch>, netdev@...r.kernel.org,
Manuel Messner <mm@...lett.io>
Subject: Re: [PATCH] lib: test_rhashtable: fix for large entry counts
On Fri, Jul 21, 2017 at 04:51:31PM +0200, Phil Sutter wrote:
> During concurrent access testing, threadfunc() concatenated thread ID
> and object index to create a unique key like so:
>
> | tdata->objs[i].value = (tdata->id << 16) | i;
>
> This breaks if a user passes an entries parameter of 64k or higher,
> since 'i' might use more than 16 bits then. Effectively, this will lead
> to duplicate keys in the table.
>
> Fix the problem by introducing a struct holding object and thread ID and
> using that as key instead of a single integer type field.
>
> Fixes: f4a3e90ba5739 ("rhashtable-test: extend to test concurrency")
> Reported by: Manuel Messner <mm@...lett.io>
> Signed-off-by: Phil Sutter <phil@....cc>
Acked-by: Herbert Xu <herbert@...dor.apana.org.au>
--
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
Powered by blists - more mailing lists