summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/chelsio
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@mellanox.com>2019-02-06 22:41:54 -0700
committerJason Gunthorpe <jgg@mellanox.com>2019-02-08 16:56:45 -0700
commit921eab1143aadf976a42cac4605b4d35159b355d (patch)
tree597549c34b64fee575f20db29f0b0ca8623a04b0 /drivers/net/ethernet/chelsio
parent0df91bb67334eebaf73d4ba32567e16d55f4f116 (diff)
downloadlinux-921eab1143aadf976a42cac4605b4d35159b355d.tar.gz
linux-921eab1143aadf976a42cac4605b4d35159b355d.tar.bz2
linux-921eab1143aadf976a42cac4605b4d35159b355d.zip
RDMA/devices: Re-organize device.c locking
The locking here started out with a single lock that covered everything and then has lately veered into crazy town. The fundamental problem is that several places need to iterate over a linked list, but also need to drop their locks to avoid deadlock during client callbacks. xarray's restartable iteration offers a simple solution to the problem. Once all the lists are xarrays we can drop locks in the places that need that and rely on xarray to provide consistency and locking for the data structure. The resulting simplification is that each of the three lists has a dedicated rwsem that must be held when working with the list it covers. One data structure is no longer covered by multiple locks. The sleeping semaphore is selected because the read side generally needs to be held over something sleeping, and using RCU reader locking in those cases is overkill. In the process this simplifies the entire registration/unregistration flow to be the expected list of setups and the reversed list of matching teardowns, and the registration lock 'refcount' can now be revised to be released after the ULPs are removed, providing a very sane semantic for this feature. Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/net/ethernet/chelsio')
0 files changed, 0 insertions, 0 deletions