[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1641803363-27550-1-git-send-email-brookxu.cn@gmail.com>
Date: Mon, 10 Jan 2022 16:29:23 +0800
From: brookxu <brookxu.cn@...il.com>
To: tj@...nel.org, axboe@...nel.dk
Cc: ming.lei@...hat.com, cgroups@...r.kernel.org,
linux-block@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] blk-throtl: avoid double charge of bio IOPS due to split
From: Chunguang Xu <brookxu@...cent.com>
After commit 900e08075202("block: move queue enter logic into
blk_mq_submit_bio()"), submit_bio_checks() moved to __submit_bio_fops()
and blk_mq_submit_bio(). The IOs go through blk_mq_submit_bio()
may be splited before entering blk-throtl, so we need to check
whether the BIO is throttled, and only update the io_split_cnt
for the THROTTLED bio to avoid double charge.
Signed-off-by: Chunguang Xu <brookxu@...cent.com>
---
block/blk-throttle.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/block/blk-throttle.c b/block/blk-throttle.c
index 39bb6e6..2b12fc7 100644
--- a/block/blk-throttle.c
+++ b/block/blk-throttle.c
@@ -2049,6 +2049,9 @@ void blk_throtl_charge_bio_split(struct bio *bio)
struct throtl_service_queue *parent_sq;
bool rw = bio_data_dir(bio);
+ if (!bio_flagged(bio, BIO_THROTTLED))
+ return;
+
do {
if (!parent->has_rules[rw])
break;
--
1.8.3.1
Powered by blists - more mailing lists