Re: [PATCH] [v2] test_rhashtable: remove semaphore usage

From: David Miller
Date: Tue Dec 18 2018 - 18:36:20 EST


From: Arnd Bergmann <arnd@xxxxxxxx>
Date: Sun, 16 Dec 2018 20:48:21 +0100

> 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@xxxxxx>
> Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
> ---
> Changes from v1:
> - rebase to mainline,
> - fix pr_err() output
> - bail out if interrupted

Applied, thanks Arnd.