aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/sw/rxe/rxe_pool.h
diff options
context:
space:
mode:
authorParav Pandit <parav@mellanox.com>2018-08-27 08:44:14 +0300
committerDoug Ledford <dledford@redhat.com>2018-08-30 16:31:50 -0400
commit66d0f207dbf0e983c8006eb2fc5060163646210f (patch)
tree9e0df1e6666c86e730e07d54c573d079860acaa9 /drivers/infiniband/sw/rxe/rxe_pool.h
parentIB/rxe: Simplify rxe_find_route() to avoid GID query for netdev (diff)
downloadlinux-dev-66d0f207dbf0e983c8006eb2fc5060163646210f.tar.xz
linux-dev-66d0f207dbf0e983c8006eb2fc5060163646210f.zip
IB/rxe: Replace spinlock with rwlock
Concurrent readers which read rb tree are protected using read lock. Concurrent writers which add element to pool are protected using write lock. Signed-off-by: Parav Pandit <parav@mellanox.com> Reviewed-by: Daniel Jurgens <danielj@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/sw/rxe/rxe_pool.h')
-rw-r--r--drivers/infiniband/sw/rxe/rxe_pool.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/sw/rxe/rxe_pool.h b/drivers/infiniband/sw/rxe/rxe_pool.h
index 47df28e43acf..6eb344236afc 100644
--- a/drivers/infiniband/sw/rxe/rxe_pool.h
+++ b/drivers/infiniband/sw/rxe/rxe_pool.h
@@ -90,7 +90,7 @@ struct rxe_pool_entry {
struct rxe_pool {
struct rxe_dev *rxe;
- spinlock_t pool_lock; /* pool spinlock */
+ rwlock_t pool_lock; /* protects pool add/del/search */
size_t elem_size;
struct kref ref_cnt;
void (*cleanup)(struct rxe_pool_entry *obj);