[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20170724.141418.2036891383541794115.davem@davemloft.net>
Date: Mon, 24 Jul 2017 14:14:18 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: phil@....cc
Cc: tgraf@...g.ch, herbert@...dor.apana.org.au, netdev@...r.kernel.org,
mm@...lett.io
Subject: Re: [PATCH] lib: test_rhashtable: fix for large entry counts
From: Phil Sutter <phil@....cc>
Date: Fri, 21 Jul 2017 16:51:31 +0200
> 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>
Applied, thanks Phil.
Powered by blists - more mailing lists