]> git.baikalelectronics.ru Git - kernel.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)
commitb32f29a68b4f275ed012cf8b1d00019b157c4a05
treeddb90f53572eddb44b6c0ba2bf72aa271841b66e
parentf65c62d2d273f19e74c0122ef5383fc4f02521d6
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