Patch "block: fix revalidate performance regression" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    block: fix revalidate performance regression

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     block-fix-revalidate-performance-regression.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 4c8caef3c9e2e4c90db8697ce768ecb05261942f
Author: Damien Le Moal <dlemoal@xxxxxxxxxx>
Date:   Mon May 29 16:32:37 2023 +0900

    block: fix revalidate performance regression
    
    [ Upstream commit 47fe1c3064c6bc1bfa3c032ff78e603e5dd6e5bc ]
    
    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 frozen, even if there are no zone resources to
    free.
    
    Avoid this overhead for non-zoned devices by not calling
    disk_clear_zone_settings() in disk_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>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/block/blk-settings.c b/block/blk-settings.c
index 8b84b4f126966..b2dfbfd08cbbd 100644
--- a/block/blk-settings.c
+++ b/block/blk-settings.c
@@ -875,6 +875,7 @@ static bool disk_has_partitions(struct gendisk *disk)
 void blk_queue_set_zoned(struct gendisk *disk, enum blk_zoned_model model)
 {
 	struct request_queue *q = disk->queue;
+	unsigned int old_model = q->limits.zoned;
 
 	switch (model) {
 	case BLK_ZONED_HM:
@@ -912,7 +913,7 @@ void blk_queue_set_zoned(struct gendisk *disk, enum blk_zoned_model model)
 		 */
 		blk_queue_zone_write_granularity(q,
 						queue_logical_block_size(q));
-	} else {
+	} else if (old_model != BLK_ZONED_NONE) {
 		disk_clear_zone_settings(disk);
 	}
 }



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux