Re: [PATCH v13 03/18] block: Preserve the order of requeued zoned writes

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

 



On 10/19/23 02:54, Bart Van Assche wrote:
> blk_mq_requeue_work() inserts requeued requests in front of other
> requests. This is fine for all request types except for sequential zoned
> writes. Hence this patch.
> 
> Note: moving this functionality into the mq-deadline I/O scheduler is
> not an option because we want to be able to use zoned storage without
> I/O scheduler.
> 
> Cc: Christoph Hellwig <hch@xxxxxx>
> Cc: Damien Le Moal <dlemoal@xxxxxxxxxx>
> Cc: Ming Lei <ming.lei@xxxxxxxxxx>
> Cc: Hannes Reinecke <hare@xxxxxxx>
> Signed-off-by: Bart Van Assche <bvanassche@xxxxxxx>
> ---
>  block/blk-mq.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/block/blk-mq.c b/block/blk-mq.c
> index 502dafa76716..ce6ddb249959 100644
> --- a/block/blk-mq.c
> +++ b/block/blk-mq.c
> @@ -1485,7 +1485,9 @@ static void blk_mq_requeue_work(struct work_struct *work)
>  			blk_mq_request_bypass_insert(rq, 0);
>  		} else {
>  			list_del_init(&rq->queuelist);
> -			blk_mq_insert_request(rq, BLK_MQ_INSERT_AT_HEAD);
> +			blk_mq_insert_request(rq,
> +					      !blk_rq_is_seq_zoned_write(rq) ?
> +					      BLK_MQ_INSERT_AT_HEAD : 0);

Something like:

		} else {
			blk_insert_t flags = BLK_MQ_INSERT_AT_HEAD;

			if (blk_rq_is_seq_zoned_write(rq))
				flags = 0;
			blk_mq_insert_request(rq, flags);
		}

would be a lot easier to read in my opinion.

-- 
Damien Le Moal
Western Digital Research




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux