]> git.baikalelectronics.ru Git - kernel.git/commit
blk-mq: avoid excessive boot delays with large lun counts
authorJeff Moyer <jmoyer@redhat.com>
Tue, 3 Nov 2015 15:40:06 +0000 (10:40 -0500)
committerJens Axboe <axboe@fb.com>
Tue, 3 Nov 2015 15:42:19 +0000 (08:42 -0700)
commit171900ab2db4a6c17918835e492d7b61841f8f59
tree38f0de79314cdf010e331897684f7097a28dbe51
parentbbae29ec9f5818ac78b93542bb062d858f299cad
blk-mq: avoid excessive boot delays with large lun counts

Hi,

Zhangqing Luo reported long boot times on a system with thousands of
LUNs when scsi-mq was enabled.  He narrowed the problem down to
blk_mq_add_queue_tag_set, where every queue is frozen in order to set
the BLK_MQ_F_TAG_SHARED flag.  Each added device will freeze all queues
added before it in sequence, which involves waiting for an RCU grace
period for each one.  We don't need to do this.  After the second queue
is added, only new queues need to be initialized with the shared tag.
We can do that by percolating the flag up to the blk_mq_tag_set, and
updating the newly added queue's hctxs if the flag is set.

This problem was introduced by commit efa6b808716ce (blk-mq: improve
support for shared tags maps).

Reported-and-tested-by: Jason Luo <zhangqing.luo@oracle.com>
Reviewed-by: Ming Lei <ming.lei@canonical.com>
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
block/blk-mq.c