On Mon, May 29, 2023 at 10:40 AM Damien Le Moal <dlemoal@xxxxxxxxxx> wrote: > > The scsi driver function sd_read_block_characteristics() always calls > disk_set_zoned() to 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 disk_clear_zone_settings() done from > disk_set_zoned() for the BLK_ZONED_NONE case results in the device > request queued to be quiesced, even if there is no zone resource to s/quiesced/frozen > free. > > Avoid this overhead for non zoned devices by not calling > disk_clear_zone_settings() in disk_set_zoned() if the device model > already was set to BLK_ZONED_NONE. > > 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>