Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1503860

Re: [PATCH 6/8] IB/hns: Replace counting semaphore event_sem with wait condition

From Arnd Bergmann <arnd@arndb.de>
Newsgroups linux.kernel
Subject Re: [PATCH 6/8] IB/hns: Replace counting semaphore event_sem with wait condition
Date 2016-10-19 17:20 +0200
Message-ID <su0OR-308-19@gated-at.bofh.it> (permalink)
References <stj7b-5TV-3@gated-at.bofh.it> <stmRr-8w6-11@gated-at.bofh.it> <stuYF-5O5-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tuesday, October 18, 2016 10:46:45 AM CEST Binoy Jayan wrote:
> Thank you for replying for the questions. I''ll look for alternatives
> for patches 6,7 and 8 and resend the series.

Ok, thanks!

I also looked at patch 8 some more and noticed that those four
functions all do the exact same sequence:

- initialize a mlx5_ib_umr_context on the stack
- assign "umrwr.wr.wr_cqe = &umr_context.cqe"
- take the semaphore
- call ib_post_send with a single ib_send_wr
- wait for the mlx5_ib_umr_done() function to get called
- if we get back a failure, print a warning and return -EFAULT.
- release the semaphore

Moving all of these into a shared helper function would be
a good cleanup, and it leaves only a single function using
the semaphore, which can then be rewritten to use something
else.

The existing completion in there can be simplified to a
wait_event, since we are waiting for the return value to
be filled.

	Arnd

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/8] infiniband: Remove semaphores Binoy Jayan <binoy.jayan@linaro.org> - 2016-10-17 18:40 +0200
  [PATCH 1/8] IB/core: iwpm_nlmsg_request: Replace semaphore with completion Binoy Jayan <binoy.jayan@linaro.org> - 2016-10-17 18:40 +0200
  [PATCH 6/8] IB/hns: Replace counting semaphore event_sem with wait condition Binoy Jayan <binoy.jayan@linaro.org> - 2016-10-17 18:40 +0200
    Re: [PATCH 6/8] IB/hns: Replace counting semaphore event_sem with wait condition Arnd Bergmann <arnd@arndb.de> - 2016-10-17 22:40 +0200
      Re: [PATCH 6/8] IB/hns: Replace counting semaphore event_sem with  wait condition Binoy Jayan <binoy.jayan@linaro.org> - 2016-10-18 07:20 +0200
        Re: [PATCH 6/8] IB/hns: Replace counting semaphore event_sem with wait condition Arnd Bergmann <arnd@arndb.de> - 2016-10-19 17:20 +0200
  [PATCH 4/8] IB/mthca: Replace semaphore poll_sem with mutex Binoy Jayan <binoy.jayan@linaro.org> - 2016-10-17 18:40 +0200
  [PATCH 3/8] IB/hns: Replace semaphore poll_sem with mutex Binoy Jayan <binoy.jayan@linaro.org> - 2016-10-17 18:40 +0200
  [PATCH 2/8] IB/core: Replace semaphore sm_sem with completion Binoy Jayan <binoy.jayan@linaro.org> - 2016-10-17 18:40 +0200
  [PATCH 5/8] IB/isert: Replace semaphore sem with completion Binoy Jayan <binoy.jayan@linaro.org> - 2016-10-17 18:40 +0200
  Re: [PATCH 0/8] infiniband: Remove semaphores Arnd Bergmann <arnd@arndb.de> - 2016-10-17 22:10 +0200
    Re: [PATCH 0/8] infiniband: Remove semaphores Arnd Bergmann <arnd@arndb.de> - 2016-10-17 22:40 +0200

csiph-web