Skip to content

Commit 3d9782f

Browse files
damien-lemoalaxboe
authored andcommitted
block: default to QD=1 writes for blk-mq rotational zoned devices
For blk-mq rotational zoned block devices (e.g. SMR HDDs), default to having zone write plugging limit write operations to a maximum queue depth of 1 for all zones. This significantly reduce write seek overhead and improves SMR HDD write throughput. For remotely connected disks with a very high network latency this features might not be useful. However, remotely connected zoned devices are rare at the moment, and we cannot know the round trip latency to pick a good default for network attached devices. System administrators can however disable this feature in that case. For BIO based (non blk-mq) rotational zoned block devices, the device driver (e.g. a DM target driver) can directly set an appropriate default. Signed-off-by: Damien Le Moal <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Bart Van Assche <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 1365b69 commit 3d9782f

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

block/blk-sysfs.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -967,6 +967,14 @@ int blk_register_queue(struct gendisk *disk)
967967
blk_mq_debugfs_register(q);
968968
blk_debugfs_unlock(q, memflags);
969969

970+
/*
971+
* For blk-mq rotational zoned devices, default to using QD=1
972+
* writes. For non-mq rotational zoned devices, the device driver can
973+
* set an appropriate default.
974+
*/
975+
if (queue_is_mq(q) && blk_queue_rot(q) && blk_queue_is_zoned(q))
976+
blk_queue_flag_set(QUEUE_FLAG_ZONED_QD1_WRITES, q);
977+
970978
ret = disk_register_independent_access_ranges(disk);
971979
if (ret)
972980
goto out_debugfs_remove;

0 commit comments

Comments
 (0)