From: Bart Van Assche <bvanassche@acm.org>
To: Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org, linux-scsi@vger.kernel.org,
Christoph Hellwig <hch@lst.de>,
Damien Le Moal <dlemoal@kernel.org>,
Bart Van Assche <bvanassche@acm.org>,
Hannes Reinecke <hare@suse.de>,
Nitesh Shetty <nj.shetty@samsung.com>,
Ming Lei <ming.lei@redhat.com>
Subject: [PATCH v21 01/12] block: Support block devices that preserve the order of write requests
Date: Thu, 17 Jul 2025 13:57:57 -0700 [thread overview]
Message-ID: <20250717205808.3292926-2-bvanassche@acm.org> (raw)
In-Reply-To: <20250717205808.3292926-1-bvanassche@acm.org>
Some storage controllers preserve the request order per hardware queue.
Some but not all device mapper drivers preserve the bio order. Introduce
the feature flag BLK_FEAT_ORDERED_HWQ to allow block drivers and stacked
drivers to indicate that the order of write commands is preserved per
hardware queue and hence that serialization of writes per zone is not
required if all pending writes are submitted to the same hardware queue.
Cc: Damien Le Moal <dlemoal@kernel.org>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Nitesh Shetty <nj.shetty@samsung.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
block/blk-settings.c | 2 ++
include/linux/blkdev.h | 6 ++++++
2 files changed, 8 insertions(+)
diff --git a/block/blk-settings.c b/block/blk-settings.c
index a000daafbfb4..45ab1d644720 100644
--- a/block/blk-settings.c
+++ b/block/blk-settings.c
@@ -698,6 +698,8 @@ int blk_stack_limits(struct queue_limits *t, struct queue_limits *b,
t->features &= ~BLK_FEAT_NOWAIT;
if (!(b->features & BLK_FEAT_POLL))
t->features &= ~BLK_FEAT_POLL;
+ if (!(b->features & BLK_FEAT_ORDERED_HWQ))
+ t->features &= ~BLK_FEAT_ORDERED_HWQ;
t->flags |= (b->flags & BLK_FLAG_MISALIGNED);
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 5f14c20c8bc0..3ea6c77746c5 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -337,6 +337,12 @@ typedef unsigned int __bitwise blk_features_t;
/* skip this queue in blk_mq_(un)quiesce_tagset */
#define BLK_FEAT_SKIP_TAGSET_QUIESCE ((__force blk_features_t)(1u << 13))
+/*
+ * The request order is preserved per hardware queue by the block driver and by
+ * the block device.
+ */
+#define BLK_FEAT_ORDERED_HWQ ((__force blk_features_t)(1u << 14))
+
/* undocumented magic for bcache */
#define BLK_FEAT_RAID_PARTIAL_STRIPES_EXPENSIVE \
((__force blk_features_t)(1u << 15))
next prev parent reply other threads:[~2025-07-17 20:58 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-17 20:57 [PATCH v21 00/12] Improve write performance for zoned UFS devices Bart Van Assche
2025-07-17 20:57 ` Bart Van Assche [this message]
2025-07-17 20:57 ` [PATCH v21 02/12] blk-mq: Restore the zone write order when requeuing Bart Van Assche
2025-07-17 20:57 ` [PATCH v21 03/12] blk-zoned: Add an argument to blk_zone_plug_bio() Bart Van Assche
2025-07-18 7:13 ` Damien Le Moal
2025-07-18 15:54 ` Bart Van Assche
2025-07-17 20:58 ` [PATCH v21 04/12] blk-zoned: Split an if-statement Bart Van Assche
2025-07-17 20:58 ` [PATCH v21 05/12] blk-zoned: Move code from disk_zone_wplug_add_bio() into its caller Bart Van Assche
2025-07-18 7:15 ` Damien Le Moal
2025-07-17 20:58 ` [PATCH v21 06/12] blk-zoned: Introduce a loop in blk_zone_wplug_bio_work() Bart Van Assche
2025-07-18 7:17 ` Damien Le Moal
2025-07-17 20:58 ` [PATCH v21 07/12] blk-zoned: Support pipelining of zoned writes Bart Van Assche
2025-07-18 7:38 ` Damien Le Moal
2025-07-18 16:29 ` Bart Van Assche
2025-07-17 20:58 ` [PATCH v21 08/12] scsi: core: Retry unaligned " Bart Van Assche
2025-07-17 20:58 ` [PATCH v21 09/12] scsi: sd: Increase retry count for " Bart Van Assche
2025-07-17 20:58 ` [PATCH v21 10/12] scsi: scsi_debug: Add the preserves_write_order module parameter Bart Van Assche
2025-07-17 20:58 ` [PATCH v21 11/12] scsi: scsi_debug: Support injecting unaligned write errors Bart Van Assche
2025-07-17 20:58 ` [PATCH v21 12/12] ufs: core: Inform the block layer about write ordering Bart Van Assche
2025-07-18 7:08 ` [PATCH v21 00/12] Improve write performance for zoned UFS devices Damien Le Moal
2025-07-18 18:30 ` Bart Van Assche
2025-07-22 1:36 ` Damien Le Moal
2025-07-22 18:24 ` Bart Van Assche
2025-07-18 7:39 ` Damien Le Moal
2025-07-18 16:32 ` Bart Van Assche
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250717205808.3292926-2-bvanassche@acm.org \
--to=bvanassche@acm.org \
--cc=axboe@kernel.dk \
--cc=dlemoal@kernel.org \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=linux-block@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=ming.lei@redhat.com \
--cc=nj.shetty@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox