Skip to content

Commit 5d53e91

Browse files
bvanasschekawasaki
authored andcommitted
block: Support block devices that preserve the order of write requests
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 <[email protected]> Cc: Hannes Reinecke <[email protected]> Cc: Nitesh Shetty <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Ming Lei <[email protected]> Signed-off-by: Bart Van Assche <[email protected]>
1 parent 8bf6490 commit 5d53e91

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

block/blk-settings.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,8 @@ int blk_stack_limits(struct queue_limits *t, struct queue_limits *b,
714714
t->features &= ~BLK_FEAT_NOWAIT;
715715
if (!(b->features & BLK_FEAT_POLL))
716716
t->features &= ~BLK_FEAT_POLL;
717+
if (!(b->features & BLK_FEAT_ORDERED_HWQ))
718+
t->features &= ~BLK_FEAT_ORDERED_HWQ;
717719

718720
t->flags |= (b->flags & BLK_FLAG_MISALIGNED);
719721

include/linux/blkdev.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,12 @@ typedef unsigned int __bitwise blk_features_t;
337337
/* skip this queue in blk_mq_(un)quiesce_tagset */
338338
#define BLK_FEAT_SKIP_TAGSET_QUIESCE ((__force blk_features_t)(1u << 13))
339339

340+
/*
341+
* The request order is preserved per hardware queue by the block driver and by
342+
* the block device.
343+
*/
344+
#define BLK_FEAT_ORDERED_HWQ ((__force blk_features_t)(1u << 14))
345+
340346
/* undocumented magic for bcache */
341347
#define BLK_FEAT_RAID_PARTIAL_STRIPES_EXPENSIVE \
342348
((__force blk_features_t)(1u << 15))

0 commit comments

Comments
 (0)