diff mbox series

[v13,10/18] scsi: sd_zbc: Only require an I/O scheduler if needed

Message ID 20231018175602.2148415-11-bvanassche@acm.org (mailing list archive)
State New, archived
Headers show
Series Improve write performance for zoned UFS devices | expand

Commit Message

Bart Van Assche Oct. 18, 2023, 5:54 p.m. UTC
An I/O scheduler that serializes zoned writes is only needed if the SCSI
LLD does not preserve the write order. Hence only set
ELEVATOR_F_ZBD_SEQ_WRITE if the LLD does not preserve the write order.

Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Cc: Martin K. Petersen <martin.petersen@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/sd_zbc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Damien Le Moal Oct. 19, 2023, 12:26 a.m. UTC | #1
On 10/19/23 02:54, Bart Van Assche wrote:
> An I/O scheduler that serializes zoned writes is only needed if the SCSI
> LLD does not preserve the write order. Hence only set
> ELEVATOR_F_ZBD_SEQ_WRITE if the LLD does not preserve the write order.
> 
> Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
> Cc: Martin K. Petersen <martin.petersen@oracle.com>
> Cc: Christoph Hellwig <hch@lst.de>
> Cc: Ming Lei <ming.lei@redhat.com>
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
> ---
>  drivers/scsi/sd_zbc.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/sd_zbc.c b/drivers/scsi/sd_zbc.c
> index a25215507668..718b31bed878 100644
> --- a/drivers/scsi/sd_zbc.c
> +++ b/drivers/scsi/sd_zbc.c
> @@ -955,7 +955,9 @@ int sd_zbc_read_zones(struct scsi_disk *sdkp, u8 buf[SD_BUF_SIZE])
>  
>  	/* The drive satisfies the kernel restrictions: set it up */
>  	blk_queue_flag_set(QUEUE_FLAG_ZONE_RESETALL, q);
> -	blk_queue_required_elevator_features(q, ELEVATOR_F_ZBD_SEQ_WRITE);
> +	if (!q->limits.driver_preserves_write_order)

Where is this limit introduced ? I do not see it anywhere in your patches. Did I
miss something ?

> +		blk_queue_required_elevator_features(q,
> +						     ELEVATOR_F_ZBD_SEQ_WRITE);
>  	if (sdkp->zones_max_open == U32_MAX)
>  		disk_set_max_open_zones(disk, 0);
>  	else
Bart Van Assche Oct. 19, 2023, 4:54 p.m. UTC | #2
On 10/18/23 17:26, Damien Le Moal wrote:
> On 10/19/23 02:54, Bart Van Assche wrote:
>>   	/* The drive satisfies the kernel restrictions: set it up */
>>   	blk_queue_flag_set(QUEUE_FLAG_ZONE_RESETALL, q);
>> -	blk_queue_required_elevator_features(q, ELEVATOR_F_ZBD_SEQ_WRITE);
>> +	if (!q->limits.driver_preserves_write_order)
> 
> Where is this limit introduced ? I do not see it anywhere in your patches. Did I
> miss something ?

Hi Damien,

Please take another look at patch 01/18 of this series. I think that you
have seen that patch before since a Reviewed-by tag was posted by you on
August 17. See also 
https://lore.kernel.org/linux-block/6d823671-db2b-2280-0c93-87d03a2f471e@kernel.org/.

Thanks,

Bart.
Damien Le Moal Oct. 19, 2023, 10:43 p.m. UTC | #3
On 10/20/23 01:54, Bart Van Assche wrote:
> On 10/18/23 17:26, Damien Le Moal wrote:
>> On 10/19/23 02:54, Bart Van Assche wrote:
>>>   	/* The drive satisfies the kernel restrictions: set it up */
>>>   	blk_queue_flag_set(QUEUE_FLAG_ZONE_RESETALL, q);
>>> -	blk_queue_required_elevator_features(q, ELEVATOR_F_ZBD_SEQ_WRITE);
>>> +	if (!q->limits.driver_preserves_write_order)
>>
>> Where is this limit introduced ? I do not see it anywhere in your patches. Did I
>> miss something ?
> 
> Hi Damien,
> 
> Please take another look at patch 01/18 of this series. I think that you
> have seen that patch before since a Reviewed-by tag was posted by you on
> August 17. See also 
> https://lore.kernel.org/linux-block/6d823671-db2b-2280-0c93-87d03a2f471e@kernel.org/.

Oops, yes, it was there :)
My apologies for the noise.
diff mbox series

Patch

diff --git a/drivers/scsi/sd_zbc.c b/drivers/scsi/sd_zbc.c
index a25215507668..718b31bed878 100644
--- a/drivers/scsi/sd_zbc.c
+++ b/drivers/scsi/sd_zbc.c
@@ -955,7 +955,9 @@  int sd_zbc_read_zones(struct scsi_disk *sdkp, u8 buf[SD_BUF_SIZE])
 
 	/* The drive satisfies the kernel restrictions: set it up */
 	blk_queue_flag_set(QUEUE_FLAG_ZONE_RESETALL, q);
-	blk_queue_required_elevator_features(q, ELEVATOR_F_ZBD_SEQ_WRITE);
+	if (!q->limits.driver_preserves_write_order)
+		blk_queue_required_elevator_features(q,
+						     ELEVATOR_F_ZBD_SEQ_WRITE);
 	if (sdkp->zones_max_open == U32_MAX)
 		disk_set_max_open_zones(disk, 0);
 	else