Commit 3d9782f6 authored by Damien Le Moal's avatar Damien Le Moal Committed by Jens Axboe
Browse files

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: default avatarDamien Le Moal <dlemoal@kernel.org>
Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarBart Van Assche <bvanassche@acm.org>
Reviewed-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 1365b690
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -967,6 +967,14 @@ int blk_register_queue(struct gendisk *disk)
		blk_mq_debugfs_register(q);
	blk_debugfs_unlock(q, memflags);

	/*
	 * For blk-mq rotational zoned devices, default to using QD=1
	 * writes. For non-mq rotational zoned devices, the device driver can
	 * set an appropriate default.
	 */
	if (queue_is_mq(q) && blk_queue_rot(q) && blk_queue_is_zoned(q))
		blk_queue_flag_set(QUEUE_FLAG_ZONED_QD1_WRITES, q);

	ret = disk_register_independent_access_ranges(disk);
	if (ret)
		goto out_debugfs_remove;