On 4/10/23 01:10, Damien Le Moal wrote:
On 4/8/23 08:58, Bart Van Assche wrote:
Make sure that zoned writes are submitted in LBA order.
Cc: Damien Le Moal <damien.lemoal@xxxxxxxxxxxxxxxxxx>
Cc: Christoph Hellwig <hch@xxxxxx>
Cc: Ming Lei <ming.lei@xxxxxxxxxx>
Cc: Mike Snitzer <snitzer@xxxxxxxxxx>
Signed-off-by: Bart Van Assche <bvanassche@xxxxxxx>
---
block/mq-deadline.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/mq-deadline.c b/block/mq-deadline.c
index 50a9d3b0a291..891ee0da73ac 100644
--- a/block/mq-deadline.c
+++ b/block/mq-deadline.c
@@ -798,7 +798,7 @@ static void dd_insert_request(struct blk_mq_hw_ctx *hctx, struct request *rq,
trace_block_rq_insert(rq);
- if (at_head) {
+ if (at_head && !blk_rq_is_seq_zoned_write(rq)) {
list_add(&rq->queuelist, &per_prio->dispatch);
rq->fifo_time = jiffies;
} else {
Looks OK, but I would prefer us addressing the caller site using at_head = true,
as that is almost always completely wrong for sequential zone writes.
That would reduce the number of places we check for blk_rq_is_seq_zoned_write().
Hi Damien,
The code for deciding whether or not to use head insertion is spread all
over the block layer. I prefer a single additional check to disable head
insertion instead of modifying all the code that decides whether or not
to use head-insertion. Additionally, the call to
blk_rq_is_seq_zoned_write() would remain if the decision whether or not
to use head insertion is moved into the callers of
elevator_type.insert_request.
Thanks,
Bart.