All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] block/blk-ioprio: Skip zoned writes that are not append operations
@ 2023-12-11 23:14 Bart Van Assche
  2023-12-11 23:31 ` Damien Le Moal
  0 siblings, 1 reply; 5+ messages in thread
From: Bart Van Assche @ 2023-12-11 23:14 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-block, Bart Van Assche, Damien Le Moal, Christoph Hellwig

If REQ_OP_WRITE or REQ_OP_WRITE_ZEROES operations for the same zone
originate from different cgroups that could result in different
priorities being assigned to these operations. Do not modify the I/O
priority of these write operations to prevent that these would be
executed in the wrong order when using the mq-deadline I/O
scheduler.

Cc: Damien Le Moal <dlemoal@kernel.org>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 block/blk-ioprio.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/block/blk-ioprio.c b/block/blk-ioprio.c
index 4051fada01f1..09ce083a0e3a 100644
--- a/block/blk-ioprio.c
+++ b/block/blk-ioprio.c
@@ -192,6 +192,17 @@ void blkcg_set_ioprio(struct bio *bio)
 	if (!blkcg || blkcg->prio_policy == POLICY_NO_CHANGE)
 		return;
 
+	/*
+	 * If REQ_OP_WRITE or REQ_OP_WRITE_ZEROES operations for the same zone
+	 * originate from different cgroups that could result in different
+	 * priorities being assigned to these operations. Do not modify the I/O
+	 * priority of these write operations to prevent that these would be
+	 * executed in the wrong order when using the mq-deadline I/O
+	 * scheduler.
+	 */
+	if (bdev_op_is_zoned_write(bio->bi_bdev, bio_op(bio)))
+		return;
+
 	if (blkcg->prio_policy == POLICY_PROMOTE_TO_RT ||
 	    blkcg->prio_policy == POLICY_NONE_TO_RT) {
 		/*

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-12-12 21:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-11 23:14 [PATCH] block/blk-ioprio: Skip zoned writes that are not append operations Bart Van Assche
2023-12-11 23:31 ` Damien Le Moal
2023-12-12  0:11   ` Bart Van Assche
2023-12-12 10:08     ` Damien Le Moal
2023-12-12 21:26     ` kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.