]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit25e377b22cc3f4800ebf6b9951af80ae115974af
tree4fbd0d0a6421a0940ef7a9bbedb1726a40e17b64
parent7d990aa46412e5bf24acac6e92b5ffe07513d8d9
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