diff options
author | Haggai Eran <haggaie@mellanox.com> | 2015-07-30 17:50:13 +0300 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2015-08-30 15:48:15 -0400 |
commit | 5aa44bb90f047662c12c44be1b6de454658632d0 (patch) | |
tree | ef9f18b75a5794c055e5fa8c8fd3a38ae2d1e231 /net/rds | |
parent | 3403051ebbd486a342272a404f16e7f1aca8758e (diff) | |
download | op-kernel-dev-5aa44bb90f047662c12c44be1b6de454658632d0.zip op-kernel-dev-5aa44bb90f047662c12c44be1b6de454658632d0.tar.gz |
IB/core: Add rwsem to allow reading device list or client list
Currently the RDMA subsystem's device list and client list are protected by
a single mutex. This prevents adding user-facing APIs that iterate these
lists, since using them may cause a deadlock. The patch attempts to solve
this problem by adding a read-write semaphore to protect the lists. Readers
now don't need the mutex, and are safe just by read-locking the semaphore.
The ib_register_device, ib_register_client, ib_unregister_device, and
ib_unregister_client functions are modified to lock the semaphore for write
during their respective list modification. Also, in order to make sure
client callbacks are called only between add() and remove() calls, the code
is changed to only add items to the lists after the add() calls and remove
from the lists before the remove() calls.
This patch attempts to solve a similar need [1] that was seen in the RoCE
v2 patch series.
[1] http://www.spinics.net/lists/linux-rdma/msg24733.html
Reviewed-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Cc: Matan Barak <matanb@mellanox.com>
Signed-off-by: Haggai Eran <haggaie@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'net/rds')
0 files changed, 0 insertions, 0 deletions