Re: [RFC PATCH] blk-iocost: introduce 'linear-max' cost model for cloud disk

From: Jialin Wang

Date: Fri Feb 13 2026 - 07:02:40 EST


On Fri, Feb 13, 2026 at 5:42 PM Jialin Wang <wjl.linux@xxxxxxxxx> wrote:
> > This formula correctly models the dual-bucket behavior of cloud disks.
> > It ensures that for any block size, the calculated cost aligns with the
> > actual bottleneck (IOPS or BPS). This allows the system to reach close
> > to the provisioned BPS/IOPS limits without premature throttling, while
> > still maintaining the latency protection benefits of iocost.
>
> This model still has some limitations. Under workloads with mixed IO sizes and
> vrate max at 100%, it fail to fully saturate the hardware performance.
> However, it still demonstrates a clear improvement over the linear model.
>
> The following fio benchmarks were conducted with two cgroups assigned equal weights:
>
> Cgroup A: fio --bs=32k ...
> Cgroup B: fio --bs=1M ...
>
> Results:
>
> Model | Cgroup A (32k) | Cgroup B (1M) | Total
> ------------+------------------------+----------------------|----------------------
> linear | 1137 IOPS (35.5 MiB/s) | 79 IOPS (79.5 MiB/s) | 1216 IOPS 115.0 MiB/s
> linear-max | 1781 IOPS (55.7 MiB/s) | 83 IOPS (83.9 MiB/s) | 1864 IOPS 139.6 MiB/s

One potential long-term solution might be to separate the accounting for IOPS
and BPS. By tracking two independent vtime counters (vtime_ios and vtime_bytes)
with their own weights, we could apply throttling based on the specific
resource being consumed. This would avoid cases where high-bandwidth requests
unnecessarily eat up the IOPS budget, and vice versa. I would love to hear your
thoughts on this idea. Is this a direction worth exploring, or would the added
complexity be a concern?

Thanks,
Jialin Wang