]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
blk-throtl: optimize IOPS throttle for large IO scenarios
authorChunguang Xu <brookxu@tencent.com>
Mon, 2 Aug 2021 03:51:56 +0000 (11:51 +0800)
committerJens Axboe <axboe@kernel.dk>
Sun, 15 Aug 2021 01:14:56 +0000 (19:14 -0600)
commit4f1e9630afe6332de7286820fedd019f19eac057
tree470518b99f9dcee9e8c73f5772c755860bfdb279
parent3d2e79894bd7adc7d14638a0c72ceb8b722d1fa3
blk-throtl: optimize IOPS throttle for large IO scenarios

After patch 54efd50 (block: make generic_make_request handle
arbitrarily sized bios), the IO through io-throttle may be larger,
and these IOs may be further split into more small IOs. However,
IOPS throttle does not seem to be aware of this change, which
makes the calculation of IOPS of large IOs incomplete, resulting
in disk-side IOPS that does not meet expectations. Maybe we should
fix this problem.

We can reproduce it by set max_sectors_kb of disk to 128, set
blkio.write_iops_throttle to 100, run a dd instance inside blkio
and use iostat to watch IOPS:

dd if=/dev/zero of=/dev/sdb bs=1M count=1000 oflag=direct

As a result, without this change the average IOPS is 1995, with
this change the IOPS is 98.

Signed-off-by: Chunguang Xu <brookxu@tencent.com>
Acked-by: Tejun Heo <tj@kernel.org>
Link: https://lore.kernel.org/r/65869aaad05475797d63b4c3fed4f529febe3c26.1627876014.git.brookxu@tencent.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-merge.c
block/blk-throttle.c
block/blk.h