]> git.baikalelectronics.ru Git - kernel.git/commit
nvme-fabrics: Convert nvmf_transports_mutex to an rwsem
authorRoland Dreier <roland@purestorage.com>
Tue, 29 Aug 2017 17:33:44 +0000 (10:33 -0700)
committerChristoph Hellwig <hch@lst.de>
Wed, 30 Aug 2017 12:51:22 +0000 (14:51 +0200)
commit8899457b0a878753eadfa72f1da5ffc0a504f66a
tree691ea6f4c3c58798b364c927aa80af998c3f555d
parentb00f62ee4c4305a50156fb0031f09aeec355faf5
nvme-fabrics: Convert nvmf_transports_mutex to an rwsem

The mutex protects against the list of transports changing while a
controller is being created, but using a plain old mutex means that it
also serializes controller creation.  This unnecessarily slows down
creating multiple controllers - for example for the RDMA transport,
creating a controller involves establishing one connection for every IO
queue, which involves even more network/software round trips, so the
delay can become significant.

The simplest way to fix this is to change the mutex to an rwsem and only
hold it for writing when the list is being mutated.  Since we can take
the rwsem for reading while creating a controller, we can create multiple
controllers in parallel.

Signed-off-by: Roland Dreier <roland@purestorage.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/fabrics.c