blk-throttle: Split the service queue
authorZizhi Wo <wozizhi@huawei.com>
Tue, 6 May 2025 02:09:33 +0000 (10:09 +0800)
committerJens Axboe <axboe@kernel.dk>
Tue, 13 May 2025 18:08:27 +0000 (12:08 -0600)
commit28ad83b774a6f11126d45bf912bb8a7c16cb2b2b
treed580400cc6264a000d63cff531b4ed66f73e9e94
parentf2c4902bd08b854a23c3c2ab352382fd7eef959f
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>
block/blk-throttle.c
block/blk-throttle.h