]> asedeno.scripts.mit.edu Git - linux.git/commit
IB/uverbs: Revise and clarify the rwsem and uobjects_lock
authorJason Gunthorpe <jgg@mellanox.com>
Wed, 11 Jul 2018 02:55:18 +0000 (20:55 -0600)
committerJason Gunthorpe <jgg@mellanox.com>
Wed, 25 Jul 2018 20:21:22 +0000 (14:21 -0600)
commit87064277c4d3b0ddb251a91324f2525048027ee2
treeddb90f53572eddb44b6c0ba2bf72aa271841b66e
parente6d5d5ddd0869cf44a554289cd213007ccc0afde
IB/uverbs: Revise and clarify the rwsem and uobjects_lock

Rename 'cleanup_rwsem' to 'hw_destroy_rwsem' which is held across any call
to the type destroy function (aka 'hw' destroy). The main purpose of this
lock is to prevent normal add and destroy from running concurrently with
uverbs_cleanup_ufile()

Since the uobjects list is always manipulated under the 'hw_destroy_rwsem'
we can eliminate the uobjects_lock in the cleanup function. This allows
converting that lock to a very simple spinlock with a narrow critical
section.

Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/core/rdma_core.c
drivers/infiniband/core/uverbs.h
drivers/infiniband/core/uverbs_main.c