lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20181210.172912.1960183648027850219.davem@davemloft.net>
Date:   Mon, 10 Dec 2018 17:29:12 -0800 (PST)
From:   David Miller <davem@...emloft.net>
To:     arnd@...db.de
Cc:     tgraf@...g.ch, herbert@...dor.apana.org.au, neilb@...e.com,
        tom@...ntonium.net, keescook@...omium.org, paulb@...lanox.com,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] test_rhashtable: remove semaphore usage

From: Arnd Bergmann <arnd@...db.de>
Date: Mon, 10 Dec 2018 22:17:20 +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.
> 
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
> ---
> This is part of a longer, untested, series to remove semaphores
> from the kernel, please review as such before applying.

This looks fine to me, although it seems kinda weird how the
synchronization works in that the N - 1 child threads will
be awoken two times, once when child N decrements the count
to zero and once when the parent decrements the count to -1
which lets us past the wait_event_interruptibel().

Nevertheless it should work just fine and I have no problems
with it.

Want me to apply this to net-next?

Thanks.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ