]> 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)
commit03a51005de97cedb0490a8b339d221ecf410ed90
treeddb90f53572eddb44b6c0ba2bf72aa271841b66e
parentc8eb5c5027ac1294fb322cb660b894db35c7b518
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