Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1526918
| From | Christoph Hellwig <hch@infradead.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v5 2/9] IB/core: Replace semaphore sm_sem with an atomic wait |
| Date | 2016-11-21 18:00 +0100 |
| Message-ID | <sG06L-3IM-59@gated-at.bofh.it> (permalink) |
| References | <sFPXI-5Q1-7@gated-at.bofh.it> <sFQ7o-5VC-33@gated-at.bofh.it> <sG06L-3IM-47@gated-at.bofh.it> <sG06L-3IM-45@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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.
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v5 0/9] infiniband: Remove semaphores Binoy Jayan <binoy.jayan@linaro.org> - 2016-11-21 07:10 +0100
[PATCH v5 7/9] IB/mthca: Replace counting semaphore event_sem with wait_event Binoy Jayan <binoy.jayan@linaro.org> - 2016-11-21 07:10 +0100
[PATCH v5 6/9] IB/hns: Replace counting semaphore event_sem with wait_event Binoy Jayan <binoy.jayan@linaro.org> - 2016-11-21 07:10 +0100
[PATCH v5 3/9] IB/hns: Replace semaphore poll_sem with mutex Binoy Jayan <binoy.jayan@linaro.org> - 2016-11-21 07:10 +0100
[PATCH v5 8/9] IB/mlx5: Add helper mlx5_ib_post_send_wait Binoy Jayan <binoy.jayan@linaro.org> - 2016-11-21 07:10 +0100
[PATCH v5 1/9] IB/core: iwpm_nlmsg_request: Replace semaphore with completion Binoy Jayan <binoy.jayan@linaro.org> - 2016-11-21 07:10 +0100
[PATCH v5 9/9] IB/mlx5: Replace semaphore umr_common:sem with wait_event Binoy Jayan <binoy.jayan@linaro.org> - 2016-11-21 07:20 +0100
[PATCH v5 4/9] IB/mthca: Replace semaphore poll_sem with mutex Binoy Jayan <binoy.jayan@linaro.org> - 2016-11-21 07:20 +0100
[PATCH v5 5/9] IB/isert: Replace semaphore sem with completion Binoy Jayan <binoy.jayan@linaro.org> - 2016-11-21 07:20 +0100
Re: [PATCH v5 5/9] IB/isert: Replace semaphore sem with completion Sagi Grimberg <sagi@grimberg.me> - 2016-11-21 08:40 +0100
Re: [PATCH v5 5/9] IB/isert: Replace semaphore sem with completion Arnd Bergmann <arnd@arndb.de> - 2016-11-21 11:30 +0100
Re: [PATCH v5 5/9] IB/isert: Replace semaphore sem with completion Sagi Grimberg <sagi@grimberg.me> - 2016-11-21 13:40 +0100
Re: [PATCH v5 5/9] IB/isert: Replace semaphore sem with completion Arnd Bergmann <arnd@arndb.de> - 2016-11-21 16:00 +0100
[PATCH v5 2/9] IB/core: Replace semaphore sm_sem with an atomic wait Binoy Jayan <binoy.jayan@linaro.org> - 2016-11-21 07:20 +0100
Re: [PATCH v5 2/9] IB/core: Replace semaphore sm_sem with an atomic wait Christoph Hellwig <hch@infradead.org> - 2016-11-21 18:00 +0100
Re: [PATCH v5 2/9] IB/core: Replace semaphore sm_sem with an atomic wait Arnd Bergmann <arnd@arndb.de> - 2016-11-21 18:00 +0100
Re: [PATCH v5 2/9] IB/core: Replace semaphore sm_sem with an atomic wait Linus Torvalds <torvalds@linux-foundation.org> - 2016-11-21 19:00 +0100
Re: [PATCH v5 2/9] IB/core: Replace semaphore sm_sem with an atomic wait Arnd Bergmann <arnd@arndb.de> - 2016-11-22 00:00 +0100
csiph-web