Skip to content

Commit a9fc886

Browse files
Ming Leiaxboe
authored andcommitted
blk-throttle: don't take carryover for prioritized processing of metadata
Commit 29390bb ("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 <[email protected]> Cc: Josef Bacik <[email protected]> Cc: Yu Kuai <[email protected]> Signed-off-by: Ming Lei <[email protected]> Acked-by: Tejun Heo <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 483a393 commit a9fc886

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

block/blk-throttle.c

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1620,13 +1620,6 @@ static bool tg_within_limit(struct throtl_grp *tg, struct bio *bio, bool rw)
16201620
return tg_may_dispatch(tg, bio, NULL);
16211621
}
16221622

1623-
static void tg_dispatch_in_debt(struct throtl_grp *tg, struct bio *bio, bool rw)
1624-
{
1625-
if (!bio_flagged(bio, BIO_BPS_THROTTLED))
1626-
tg->carryover_bytes[rw] -= throtl_bio_data_size(bio);
1627-
tg->carryover_ios[rw]--;
1628-
}
1629-
16301623
bool __blk_throtl_bio(struct bio *bio)
16311624
{
16321625
struct request_queue *q = bdev_get_queue(bio->bi_bdev);
@@ -1663,10 +1656,12 @@ bool __blk_throtl_bio(struct bio *bio)
16631656
/*
16641657
* IOs which may cause priority inversions are
16651658
* dispatched directly, even if they're over limit.
1666-
* Debts are handled by carryover_bytes/ios while
1667-
* calculating wait time.
1659+
*
1660+
* Charge and dispatch directly, and our throttle
1661+
* control algorithm is adaptive, and extra IO bytes
1662+
* will be throttled for paying the debt
16681663
*/
1669-
tg_dispatch_in_debt(tg, bio, rw);
1664+
throtl_charge_bio(tg, bio);
16701665
} else {
16711666
/* if above limits, break to queue */
16721667
break;

0 commit comments

Comments
 (0)