mbox series

[V4,0/8] block: improve iops limit throttle

Message ID 20220216044514.2903784-1-ming.lei@redhat.com (mailing list archive)
Headers show
Series block: improve iops limit throttle | expand

Message

Ming Lei Feb. 16, 2022, 4:45 a.m. UTC
Hello Guys,

Lining reported that iops limit throttle doesn't work on dm-thin, also
iops limit throttle works bad on plain disk in case of excessive split.

Commit 4f1e9630afe6 ("blk-throtl: optimize IOPS throttle for large IO scenarios")
was for addressing this issue, but the taken approach is just to run
post-accounting, then current split bios won't be throttled actually,
so actual iops throttle result isn't good in case of excessive bio
splitting.

The 1st three patches are cleanup.

The 4th patches add one new local helper of submit_bio_noacct_nocheck() for
blk_throtl_dispatch_work_fn(), so that bios won't be throttled any more
when blk-throttle code dispatches throttled bios.

The 5th patch merges merge submit_bio_checks() into submit_bio_noacct
as suggested by Christoph.

The 6th and 7th patch makes the real difference for throttling split bio wrt.
iops limit.

The last patch is to revert commit 4f1e9630afe6 ("blk-throtl: optimize IOPS
throttle for large IO scenarios").

Ning Li has verified that iops throttle is improved much on the posted
RFC V1 version.

V4:
	- remove wrapper in 4/8
	- early return in 5/8

V3:
	- add reviewed-by/acked-by tag
	- patch style change 2/8
	- mark submit_bio_checks as static 3/8
	- move ubmit_bio_checks() into submit_bio_noacct 5/8

V2:
	- remove RFC
	- don't add/export __submit_bio_noacct(), instead add one new local
	helper of submit_bio_noacct_nocheck() per Christoph's suggestion



Ming Lei (8):
  block: move submit_bio_checks() into submit_bio_noacct
  block: move blk_crypto_bio_prep() out of blk-mq.c
  block: don't declare submit_bio_checks in local header
  block: don't check bio in blk_throtl_dispatch_work_fn
  block: merge submit_bio_checks() into submit_bio_noacct
  block: throttle split bio in case of iops limit
  block: don't try to throttle split bio if iops limit isn't set
  block: revert 4f1e9630afe6 ("blk-throtl: optimize IOPS throttle for
    large IO scenarios")

 block/blk-core.c     | 248 +++++++++++++++++++++----------------------
 block/blk-merge.c    |   2 -
 block/blk-mq.c       |   3 -
 block/blk-throttle.c |  61 ++++-------
 block/blk-throttle.h |  16 +--
 block/blk.h          |   2 +-
 6 files changed, 153 insertions(+), 179 deletions(-)

Comments

Jens Axboe Feb. 17, 2022, 2:42 a.m. UTC | #1
On Wed, 16 Feb 2022 12:45:06 +0800, Ming Lei wrote:
> Lining reported that iops limit throttle doesn't work on dm-thin, also
> iops limit throttle works bad on plain disk in case of excessive split.
> 
> Commit 4f1e9630afe6 ("blk-throtl: optimize IOPS throttle for large IO scenarios")
> was for addressing this issue, but the taken approach is just to run
> post-accounting, then current split bios won't be throttled actually,
> so actual iops throttle result isn't good in case of excessive bio
> splitting.
> 
> [...]

Applied, thanks!

[1/8] block: move submit_bio_checks() into submit_bio_noacct
      commit: a650628bde77f6ac5b1d532092346feff7b58c52
[2/8] block: move blk_crypto_bio_prep() out of blk-mq.c
      commit: 7f36b7d02a287ed18d02ae821868aa07b0235521
[3/8] block: don't declare submit_bio_checks in local header
      commit: 29ff23624e21c89d3321d6429dec8ad3847b534a
[4/8] block: don't check bio in blk_throtl_dispatch_work_fn
      commit: 3f98c753717c600eb5708e9b78b3eba6664bddf1
[5/8] block: merge submit_bio_checks() into submit_bio_noacct
      commit: d24c670ec1f9f1dc320e59004e61f3491ae24546
[6/8] block: throttle split bio in case of iops limit
      commit: 9f5ede3c01f9951b0ae7d68b28762ad51d9bacc8
[7/8] block: don't try to throttle split bio if iops limit isn't set
      commit: 5a93b6027eb4ef5db60a4bc5bdbeba5fb9f29384
[8/8] block: revert 4f1e9630afe6 ("blk-throtl: optimize IOPS throttle for large IO scenarios")
      commit: 34841e6fb125aa3f0e33e4eaac9f5eb86b2bb34b

Best regards,