Re: [PATCH v3 0/4] blk-iocost: charge flushes and zone appends
From: Tejun Heo
Date: Mon Sep 21 2026 - 14:42:42 EST
Hello, Tao.
On Mon, Sep 21, 2026 at 11:34:49AM +0800, Tao Cui wrote:
> While testing iocost's weight-based throttling under concurrent IO, we
> observed that a cgroup limited to 1% weight could issue an unbounded
> number of flushes without being throttled: an fsync loop produced ~510k
> flushes in 12s with cost.usage staying at zero the entire time. The
> device was monopolized while iocost reported no activity. Zone appends
> were in the same position: the builtin linear cost model defines
> coefficients only for READ and WRITE, so REQ_OP_ZONE_APPEND is priced
> at zero and excluded from the latency statistics as well.
Looks good to me. A few nits:
- 1/4: REQ_PREFLUSH and REQ_FUA are in REQ_NOMERGE_FLAGS, so !is_merge is
always true there. Can you drop the wrapper and the separate flush_cost
accumulator? Adding to cost before the empty bio check gives the same
result, and the FUA condition fits on one line.
- 1/4: The comment mostly restates the two ifs and the coefficient
formula. The FUA condition is the only non-obvious part. Can it be
trimmed to that?
- 1/4: Pending pre-flushes get coalesced into one device flush, so the
charge doesn't quite mirror what the block layer issues. It's a
per-request policy charge, which the description already says. The
other iops coefficients also have the page cost subtracted, so they
aren't translated the same way. There's also a short broken line in
that paragraph.
- 1/4: cgroup-v2.rst doesn't use REQ_* names anywhere else. Maybe
describe them as a write with a preceding cache flush and a FUA write?
The table row could follow its siblings too ("The maximum ... per
second").
For the series,
Acked-by: Tejun Heo <tj@xxxxxxxxxx>
Thanks.
--
tejun