RDMA/cm: Use RCU synchronization mechanism to protect cm_id_private xa_load()
authorDanit Goldberg <danitg@mellanox.com>
Thu, 19 Dec 2019 13:47:50 +0000 (15:47 +0200)
committerJason Gunthorpe <jgg@mellanox.com>
Fri, 3 Jan 2020 20:29:44 +0000 (16:29 -0400)
commit4d6e8a033f7c6665c7ca5c5cdcf66019baa4b7a2
tree21bdeef17da47ac914254c4e348a76d3ee6c9299
parent9f48db0d4a08624bb9ba847ea40c8abad753b396
RDMA/cm: Use RCU synchronization mechanism to protect cm_id_private xa_load()

The RCU mechanism is optimized for read-mostly scenarios and therefore
more suitable to protect the cm_id_private to decrease "cm.lock"
congestion.

This patch replaces the existing spinlock locking mechanism and kfree with
RCU mechanism in places where spinlock(cm.lock) protected xa_load
returning the cm_id_priv

In addition, delete the cm_get_id() function as there is no longer a
distinction if the caller already holds the cm_lock.

Remove an open coded version of cm_get_id().

Link: https://lore.kernel.org/r/20191219134750.413429-1-leon@kernel.org
Signed-off-by: Danit Goldberg <danitg@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Reviewed-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/core/cm.c