FAILED: patch "[PATCH] block: fix revalidate performance regression" failed to apply to 5.15-stable tree
Subsystems (2)
[email protected]
maintainerThe patch below does not apply to the 5.15-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y
git checkout FETCH_HEAD
git cherry-pick -x 47fe1c3064c6bc1bfa3c032ff78e603e5dd6e5bc
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2023060549-smolder-human-a813@gregkh' --subject-prefix 'PATCH 5.15.y' HEAD^..
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 47fe1c3064c6bc1bfa3c032ff78e603e5dd6e5bc Mon Sep 17 00:00:00 2001
From: Damien Le Moal <[email protected]>
Date: Mon, 29 May 2023 16:32:37 +0900
Subject: [PATCH] block: fix revalidate performance regression
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 <[email protected]>
block/blk-settings.c +2 -1
@@ -915,6 +915,7 @@ static bool disk_has_partitions(struct gendisk *disk)void disk_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 :
@@ -952,7 +953,7 @@ void disk_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); } }
PATCH 1/1 block: fix revalidate performance regression
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 <[email protected]>
--- block/blk-settings.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
block/blk-settings.c +2 -1
@@ -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 ) {blk_queue_clear_zone_settings (q); } }
Signature · 1 line
2.40.1
Re: [PATCH 5.15.y] block: fix revalidate performance regression
Quoted 26 lines · Damien Le Moal
commit
47fe1c3064c6bc1bfa3c032ff78e603e5dd6e5bcupstream.The scsi driver function
sd_read_block_characteristics()always callsblk_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 toBLK_ZONED_NONEand 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 fromblk_queue_set_zoned()for theBLK_ZONED_NONEcase 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()inblk_queue_set_zoned()if the device model was already set toBLK_ZONED_NONE, which is always the case for regular devices.Reported by: Brian Bunker <[email protected]>
Fixes 508aebb80527 ("block: introduce blk_queue_clear_zone_settings()")Signed-off-by Damien Le Moal <[email protected]>Reviewed-by Ming Lei <[email protected]>Signed-off-by Jens Axboe <[email protected]>
Quoted 3 lines
--- block/blk-settings.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Thanks, now queued up.
greg k-h
Quoted 6 lines · On 6/6/23 04:52, [email protected] wrote:
The patch below does not apply to the 5.15-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
Quoted 8 lines
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y
git checkoutFETCH_HEAD
git cherry-pick -x47fe1c3064c6bc1bfa3c032ff78e603e5dd6e5bc
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2023060549-smolder-human-a813@gregkh' --subject-prefix 'PATCH 5.15.y' HEAD^..
Hi Greg,
I sent a backport using the above command.
Thanks !
Quoted 64 lines
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From
47fe1c3064c6bc1bfa3c032ff78e603e5dd6e5bcMon Sep 17 00:00:00 2001
From: Damien Le Moal <[email protected]>
Date: Mon, 29 May 2023 16:32:37 +0900
Subject: [PATCH] block: fix revalidate performance regressionThe scsi driver function
sd_read_block_characteristics()always callsdisk_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 toBLK_ZONED_NONEand 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 fromdisk_set_zoned()for theBLK_ZONED_NONEcase 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()indisk_set_zoned()if the device model was already set toBLK_ZONED_NONE, which is always the case for regular devices.Reported by: Brian Bunker <[email protected]>
Fixes 508aebb80527 ("block: introduce blk_queue_clear_zone_settings()")Signed-off-by Damien Le Moal <[email protected]>Reviewed-by Ming Lei <[email protected]>Signed-off-by Jens Axboe <[email protected]>block/blk-settings.c +2
-1@@ -915,6 +915,7 @@ static bool disk_has_partitions(struct gendisk *disk)void disk_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 :@@ -952,7 +953,7 @@ void disk_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); } }
Signature · 2 lines
Damien Le Moal Western Digital Research