diff options
| author | Zizhi Wo <wozizhi@huawei.com> | 2025-05-06 10:09:32 +0800 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2025-05-13 12:08:27 -0600 |
| commit | f2c4902bd08b854a23c3c2ab352382fd7eef959f (patch) | |
| tree | b34ec85cdefd4772d7f96599ec8586afdd9ce751 /block/blk-throttle.h | |
| parent | c4da7bf54b1f76e7c5c8cc6d1c4db8b19af67c5d (diff) | |
blk-throttle: Split the blkthrotl queue
This patch splits the single queue into separate bps and iops queues. Now,
an IO request must first pass through the bps queue, then the iops queue,
and finally be dispatched. Due to the queue splitting, we need to modify
the throtl add/peek/pop function.
Additionally, the patch modifies the logic related to tg_dispatch_time().
If bio needs to wait for bps, function directly returns the bps wait time;
otherwise, it charges bps and returns the iops wait time so that bio can be
directly placed into the iops queue afterward. Note that this may lead to
more frequent updates to disptime, but the overhead is negligible for the
slow path.
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-6-wozizhi@huaweicloud.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-throttle.h')
| -rw-r--r-- | block/blk-throttle.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/block/blk-throttle.h b/block/blk-throttle.h index 2c1cfe091531..f21a2a2bf755 100644 --- a/block/blk-throttle.h +++ b/block/blk-throttle.h @@ -29,7 +29,8 @@ */ struct throtl_qnode { struct list_head node; /* service_queue->queued[] */ - struct bio_list bios; /* queued bios */ + struct bio_list bios_bps; /* queued bios for bps limit */ + struct bio_list bios_iops; /* queued bios for iops limit */ struct throtl_grp *tg; /* tg this qnode belongs to */ }; |
