]> 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)
commit35ec59530f3be2e41922aca474331bee77b0ac28
tree470518b99f9dcee9e8c73f5772c755860bfdb279
parentcd65fda2dbf2279cc1f4b603e0fba56a25c5a8e5
blk-throtl: optimize IOPS throttle for large IO scenarios

After patch 9ffb222 (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