test_rhashtable: remove semaphore usage
authorArnd Bergmann <arnd@arndb.de>
Sun, 16 Dec 2018 19:48:21 +0000 (20:48 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 18 Dec 2018 23:12:53 +0000 (15:12 -0800)
commit809c67059162e7ba85c61a83ad7547b4ffbb1e6e
tree4fbd0d0a6421a0940ef7a9bbedb1726a40e17b64
parentfa7b28c11bbf389617327ad4dd69bbbbbc16a8b4
test_rhashtable: remove semaphore usage

This is one of only two files that initialize a semaphore to a negative
value. We don't really need the two semaphores here at all, but can do
the same thing in more conventional and more effient way, by using a
single waitqueue and an atomic thread counter.

This gets us a little bit closer to eliminating classic semaphores from
the kernel. It also fixes a corner case where we fail to continue after
one of the threads fails to start up.

An alternative would be to use a split kthread_create()+wake_up_process()
and completely eliminate the separate synchronization.

Acked-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
lib/test_rhashtable.c