]> git.baikalelectronics.ru Git - 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)
commitc349bd4a204638b84faf90e8eb3daa071e1bf742
tree470518b99f9dcee9e8c73f5772c755860bfdb279
parentd3bbdddf73860077b79d95ea7bf6561a6819caae
blk-throtl: optimize IOPS throttle for large IO scenarios

After patch fbe004c (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