On Tue, Jun 06, 2023 at 08:13:49AM +0900, Damien Le Moal wrote: > commit 47fe1c3064c6bc1bfa3c032ff78e603e5dd6e5bc upstream. > > The scsi driver function sd_read_block_characteristics() always calls > blk_queue_set_zoned() to set a disk zoned model correctly, in case the > device model changed. This is done even for regular disks to set the > zoned model to BLK_ZONED_NONE and free any zone related resources if the > drive previously was zoned. > > This behavior significantly impact the time it takes to revalidate disks > on a large system as the call to blk_queue_clear_zone_settings() done > from blk_queue_set_zoned() for the BLK_ZONED_NONE case results in the > device request queued to be frozen, even if there are no zone resources > to free. > > Avoid this overhead for non-zoned devices by not calling > blk_queue_clear_zone_settings() in blk_queue_set_zoned() if the device > model was already set to BLK_ZONED_NONE, which is always the case for > regular devices. > > Reported by: Brian Bunker <brian@xxxxxxxxxxxxxxx> > Fixes: 508aebb80527 ("block: introduce blk_queue_clear_zone_settings()") > Cc: stable@xxxxxxxxxxxxxxx > Signed-off-by: Damien Le Moal <dlemoal@xxxxxxxxxx> > Reviewed-by: Ming Lei <ming.lei@xxxxxxxxxx> > Link: https://lore.kernel.org/r/20230529073237.1339862-1-dlemoal@xxxxxxxxxx > Signed-off-by: Jens Axboe <axboe@xxxxxxxxx> > --- > block/blk-settings.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) Thanks, now queued up. greg k-h