[PATCH 0/4] blk-iocost: charge flushes and zone appends
From: Tao Cui
Date: Mon Sep 07 2026 - 22:22:07 EST
From: Tao Cui <cuitao@xxxxxxxxxx>
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. On ext4, a write+fsync workload showed the same gap: the
write component was charged but the flush component was not.
The cause is that the builtin linear cost model defines coefficients
only for READ and WRITE. Standalone flushes (the dataless
REQ_OP_WRITE | REQ_PREFLUSH bios from blkdev_issue_flush()) and zone
append requests on zoned devices fall through to a cost of zero.
Zone append completions are also excluded from the latency
statistics, so the vrate feedback loop cannot respond to latency
induced by zone append operations.
1/4: charge flushes as pageless random writes with one-page floor
2/4: charge zone appends as sequential writes; skip cursor update
(ZA bi_sector is zone start, not the actual write position)
3/4: count ZA completions in latency stats (vrate feedback)
4/4: fix stale comment referring to nonexistent aux_iocg
After this series, on the same 1%-weight cgroup:
- the fsync loop is limited to 24 flushes per 12s (matching the
expected budget for the hdd profile)
- 16000 zone appends on a zoned null_blk are charged 533264 usec
- on ext4, the write+fsync workload is correctly accounted through
the journal layer (~2.2us per flush, matching the ssd_fast
profile's page-cost floor)
- sequential read throughput is unchanged
Tao Cui (4):
blk-iocost: charge flushes as pageless random writes
blk-iocost: charge zone appends as page-counted sequential writes
blk-iocost: account zone append completions in latency stats
blk-iocost: fix stale comment in ioc_rqos_throttle()
block/blk-iocost.c | 39 ++++++++++++++++++++++++++++++++-------
1 file changed, 32 insertions(+), 7 deletions(-)
--
2.43.0