mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/4] blk-iocost: charge flushes and zone appends
@ 2026-09-08  2:21 Tao Cui
  2026-09-08  2:21 ` [PATCH 1/4] blk-iocost: charge flushes as pageless random writes Tao Cui
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Tao Cui @ 2026-09-08  2:21 UTC (permalink / raw)
  To: tj, josef, axboe; +Cc: cgroups, linux-block, linux-kernel, cui.tao, Tao Cui

From: Tao Cui <cuitao@kylinos.cn>

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-09-10  5:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-08  2:21 [PATCH 0/4] blk-iocost: charge flushes and zone appends Tao Cui
2026-09-08  2:21 ` [PATCH 1/4] blk-iocost: charge flushes as pageless random writes Tao Cui
2026-09-10  5:41   ` Christoph Hellwig
2026-09-08  2:21 ` [PATCH 2/4] blk-iocost: charge zone appends as page-counted sequential writes Tao Cui
2026-09-08  2:21 ` [PATCH 3/4] blk-iocost: account zone append completions in latency stats Tao Cui
2026-09-10  5:39   ` Christoph Hellwig
2026-09-08  2:21 ` [PATCH 4/4] blk-iocost: fix stale comment in ioc_rqos_throttle() Tao Cui

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®