Skip to content
  • Ming Lei's avatar
    blk-mq: avoid to synchronize rcu inside blk_cleanup_queue() · bbcdd751
    Ming Lei authored
    [ Upstream commit 1311326c ]
    
    SCSI probing may synchronously create and destroy a lot of request_queues
    for non-existent devices. Any synchronize_rcu() in queue creation or
    destroy path may introduce long latency during booting, see detailed
    description in comment of blk_register_queue().
    
    This patch removes one synchronize_rcu() inside blk_cleanup_queue()
    for this case, commit c2856ae2(blk-mq: quiesce queue before freeing queue)
    needs synchronize_rcu() for implementing blk_mq_quiesce_queue(), but
    when queue isn't initialized, it isn't necessary to do that since
    only pass-through requests are involved, no original issue in
    scsi_execute() at all.
    
    Without this patch and previous one, it may take more 20+ seconds for
    virtio-scsi to complete disk probe. With the two patches, the time becomes
    less than 100ms.
    
    Fixes: c2856ae2 ("blk-mq: quiesce queue before freeing queue")
    Reported-by: Andrew Jones <drjone...
    bbcdd751