summaryrefslogtreecommitdiff
path: root/block/blk-throttle.h
diff options
context:
space:
mode:
authorZizhi Wo2025-05-06 10:09:33 +0800
committerJens Axboe2025-05-13 12:08:27 -0600
commit28ad83b774a6f11126d45bf912bb8a7c16cb2b2b (patch)
treed580400cc6264a000d63cff531b4ed66f73e9e94 /block/blk-throttle.h
parentf2c4902bd08b854a23c3c2ab352382fd7eef959f (diff)
blk-throttle: Split the service queue
This patch splits throtl_service_queue->nr_queued into "nr_queued_bps" and "nr_queued_iops", allowing separate accounting of BPS and IOPS queued bios. This prepares for future changes that need to check whether the BPS or IOPS queues are empty. To facilitate updating the number of IOs in the BPS and IOPS queues, the addition logic will be moved from throtl_add_bio_tg() to throtl_qnode_add_bio(), and similarly, the removal logic will be moved from tg_dispatch_one_bio() to throtl_pop_queued(). And introduce sq_queued() to calculate the total sum of sq->nr_queued. Signed-off-by: Zizhi Wo <wozizhi@huawei.com> Reviewed-by: Yu Kuai <yukuai3@huawei.com> Signed-off-by: Zizhi Wo <wozizhi@huaweicloud.com> Link: https://lore.kernel.org/r/20250506020935.655574-7-wozizhi@huaweicloud.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-throttle.h')
-rw-r--r--block/blk-throttle.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/block/blk-throttle.h b/block/blk-throttle.h
index f21a2a2bf755..ab892c0bd70f 100644
--- a/block/blk-throttle.h
+++ b/block/blk-throttle.h
@@ -42,7 +42,8 @@ struct throtl_service_queue {
* children throtl_grp's.
*/
struct list_head queued[2]; /* throtl_qnode [READ/WRITE] */
- unsigned int nr_queued[2]; /* number of queued bios */
+ unsigned int nr_queued_bps[2]; /* number of queued bps bios */
+ unsigned int nr_queued_iops[2]; /* number of queued iops bios */
/*
* RB tree of active children throtl_grp's, which are sorted by