From: Ming Lei <ming.lei@redhat.com>
To: Jens Axboe <axboe@kernel.dk>, linux-block@vger.kernel.org
Cc: Ming Lei <ming.lei@redhat.com>, Tejun Heo <tj@kernel.org>,
Josef Bacik <josef@toxicpanda.com>, Yu Kuai <yukuai3@huawei.com>
Subject: [PATCH 2/3] blk-throttle: don't take carryover for prioritized processing of metadata
Date: Wed, 5 Mar 2025 12:31:20 +0800 [thread overview]
Message-ID: <20250305043123.3938491-3-ming.lei@redhat.com> (raw)
In-Reply-To: <20250305043123.3938491-1-ming.lei@redhat.com>
Commit 29390bb5661d ("blk-throttle: support prioritized processing of metadata")
takes bytes/ios carryover for prioritized processing of metadata. Turns out
we can support it by charging it directly without trimming slice, and the
result is same with carryover.
Cc: Tejun Heo <tj@kernel.org>
Cc: Josef Bacik <josef@toxicpanda.com>
Cc: Yu Kuai <yukuai3@huawei.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
---
block/blk-throttle.c | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
diff --git a/block/blk-throttle.c b/block/blk-throttle.c
index 213e7b04617a..7271aee94faf 100644
--- a/block/blk-throttle.c
+++ b/block/blk-throttle.c
@@ -1620,13 +1620,6 @@ static bool tg_within_limit(struct throtl_grp *tg, struct bio *bio, bool rw)
return tg_may_dispatch(tg, bio, NULL);
}
-static void tg_dispatch_in_debt(struct throtl_grp *tg, struct bio *bio, bool rw)
-{
- if (!bio_flagged(bio, BIO_BPS_THROTTLED))
- tg->carryover_bytes[rw] -= throtl_bio_data_size(bio);
- tg->carryover_ios[rw]--;
-}
-
bool __blk_throtl_bio(struct bio *bio)
{
struct request_queue *q = bdev_get_queue(bio->bi_bdev);
@@ -1663,10 +1656,12 @@ bool __blk_throtl_bio(struct bio *bio)
/*
* IOs which may cause priority inversions are
* dispatched directly, even if they're over limit.
- * Debts are handled by carryover_bytes/ios while
- * calculating wait time.
+ *
+ * Charge and dispatch directly, and our throttle
+ * control algorithm is adaptive, and extra IO bytes
+ * will be throttled for paying the debt
*/
- tg_dispatch_in_debt(tg, bio, rw);
+ throtl_charge_bio(tg, bio);
} else {
/* if above limits, break to queue */
break;
--
2.47.0
next prev parent reply other threads:[~2025-03-05 4:32 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-05 4:31 [PATCH 0/3] blk-throttle: remove last_bytes/ios and carryover byte/ios Ming Lei
2025-03-05 4:31 ` [PATCH 1/3] blk-throttle: remove last_bytes_disp and last_ios_disp Ming Lei
2025-03-05 19:07 ` Tejun Heo
2025-03-05 4:31 ` Ming Lei [this message]
2025-03-05 19:11 ` [PATCH 2/3] blk-throttle: don't take carryover for prioritized processing of metadata Tejun Heo
2025-03-05 4:31 ` [PATCH 3/3] blk-throttle: carry over directly Ming Lei
2025-03-05 19:16 ` Tejun Heo
2025-04-11 2:53 ` Yu Kuai
2025-04-11 15:01 ` Ming Lei
2025-04-12 0:37 ` Yu Kuai
2025-04-14 2:32 ` Ming Lei
2025-04-14 11:47 ` Yu Kuai
2025-03-05 23:25 ` [PATCH 0/3] blk-throttle: remove last_bytes/ios and carryover byte/ios Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250305043123.3938491-3-ming.lei@redhat.com \
--to=ming.lei@redhat.com \
--cc=axboe@kernel.dk \
--cc=josef@toxicpanda.com \
--cc=linux-block@vger.kernel.org \
--cc=tj@kernel.org \
--cc=yukuai3@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.