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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 21 Nov 2016 08:57:52 -0800
From:   Christoph Hellwig <hch@...radead.org>
To:     Arnd Bergmann <arnd@...db.de>
Cc:     Linus Torvalds <torvalds@...ux-foundation.org>,
        Binoy Jayan <binoy.jayan@...aro.org>,
        linux-rdma@...r.kernel.org,
        Mustafa Ismail <mustafa.ismail@...el.com>,
        Lijun Ou <oulijun@...wei.com>,
        Nicholas Bellinger <nab@...ux-iscsi.org>,
        Leon Romanovsky <leonro@...lanox.com>,
        target-devel@...r.kernel.org,
        Tatyana E Nikolova <tatyana.e.nikolova@...el.com>,
        Doug Ledford <dledford@...hat.com>,
        Jenny Derzhavetz <jennyf@...lanox.com>,
        Sagi Grimberg <sagi@...mberg.me>,
        Sean Hefty <sean.hefty@...el.com>,
        Faisal Latif <faisal.latif@...el.com>,
        Hal Rosenstock <hal.rosenstock@...il.com>,
        linux-kernel@...r.kernel.org,
        "Wei Hu(Xavier)" <xavier.huwei@...wei.com>,
        Mark Brown <broonie@...nel.org>,
        Mark Bloch <markb@...lanox.com>,
        Steve Wise <swise@...ngridcomputing.com>,
        Ira Weiny <ira.weiny@...el.com>,
        Bart Van Assche <bart.vanassche@...disk.com>,
        Matan Barak <matanb@...lanox.com>,
        Sagi Grimberg <sagig@...lanox.com>
Subject: Re: [PATCH v5 2/9] IB/core: Replace semaphore sm_sem with an atomic
 wait

On Mon, Nov 21, 2016 at 05:52:27PM +0100, Arnd Bergmann wrote:
> I think a mutex would't work here, since fops->open() and fops->close()
> are not called from the same context and lockdep will complain
> about that.
> 
> Version of the series had replaced the semaphore with a completion
> here, which worked correctly, but one reviewer suggested using
> the wait_event() instead since it's confusing to have a completion
> starting out in 'completed' state.

On the other hand the existing semaphore works perfectly fine, and
is way easier to understand than any of the other models, which also
don't provide any benefit at all.

Please stop messing with perfectly fine semaphores now - there are
plenty that are much better replaced with mutexes or completions,
but this (and various others are not).  Leave them alone and do
something useful instead.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ