Re: [PATCH] block: throttle: charge io re-submission for iops limit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Ming:

I think it may be due to other reasons, I test this patch seems work fine,
Can you verify it in your environment?


>From 2c7305042e71d0f53ca50a8a3f2eebe6a2dcdb86 Mon Sep 17 00:00:00 2001
From: Chunguang Xu <brookxu@xxxxxxxxxxx>
Date: Thu, 6 Jan 2022 15:18:50 +0800
Subject: [PATCH] blk-throtl: avoid double charge of bio IOPS due to split

After commit 900e08075202("block: move queue enter logic into
blk_mq_submit_bio()"), submit_bio_checks() is moved from the
entrance of the IO stack to the specific submit_bio() entrance.
Therefore, the IO may be splited before entering blk-throtl, so
we need to check whether the BIO is throttled, and only need
to update the io_split_cnt for the throttled bio to avoid
double charge.

Signed-off-by: Chunguang Xu <brookxu@xxxxxxxxxxx>
---
 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




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux