Skip to content

blk-iocost: charge flushes and zone appends - #1266

Closed
blktests-ci-kpd[bot] wants to merge 4 commits into
linus-master_basefrom
series/1160080=>linus-master
Closed

blktests-ci-kpd[bot] wants to merge 4 commits into
linus-master_basefrom
series/1160080=>linus-master

Conversation

@blktests-ci-kpd

Copy link
Copy Markdown

Pull request for series with
subject: blk-iocost: charge flushes and zone appends
version: 1
url: https://patchwork.kernel.org/series/1160080/

@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 28924df
series: https://patchwork.kernel.org/series/1160080/
version: 1

@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 893e117
series: https://patchwork.kernel.org/series/1160080/
version: 1

@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1160080=>linus-master branch from 8338fac to 75680f9 Compare September 9, 2026 07:47
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 50d05c7
series: https://patchwork.kernel.org/series/1160080/
version: 1

@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1160080=>linus-master branch from 75680f9 to 1f6628a Compare September 10, 2026 15:34
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 5225b8e
series: https://patchwork.kernel.org/series/1160080/
version: 1

@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 2f0c1cf
series: https://patchwork.kernel.org/series/1160080/
version: 1

@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1160080=>linus-master branch from cefd9cc to 5c91b68 Compare September 13, 2026 09:39
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 2f0c1cf
series: https://patchwork.kernel.org/series/1160080/
version: 1

@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1160080=>linus-master branch from 5c91b68 to d842f75 Compare September 13, 2026 22:59
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 5878583
series: https://patchwork.kernel.org/series/1160080/
version: 1

@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1160080=>linus-master branch from d842f75 to 80c2f17 Compare September 15, 2026 09:33
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 5878583
series: https://patchwork.kernel.org/series/1166249/
version: 2

@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1160080=>linus-master branch from 8570656 to 0fdd559 Compare October 1, 2026 16:54
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: ce1e022
series: https://patchwork.kernel.org/series/1170993/
version: 4

@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1160080=>linus-master branch from 0fdd559 to 99ba06a Compare October 1, 2026 23:56
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: e767a4e
series: https://patchwork.kernel.org/series/1170993/
version: 4

@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1160080=>linus-master branch from 99ba06a to d574901 Compare October 3, 2026 10:20
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: a74306e
series: https://patchwork.kernel.org/series/1170993/
version: 4

@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1160080=>linus-master branch from d574901 to ef0e09c Compare October 3, 2026 22:28
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: None
series: https://patchwork.kernel.org/series/1170993/
version: 4

@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1160080=>linus-master branch from ef0e09c to a506584 Compare October 5, 2026 02:36
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 22430ae
series: https://patchwork.kernel.org/series/1170993/
version: 4

@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1160080=>linus-master branch from a506584 to 7c4d6ef Compare October 6, 2026 13:20
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 69f80fe
series: https://patchwork.kernel.org/series/1170993/
version: 4

@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1160080=>linus-master branch from 7c4d6ef to ed5d608 Compare October 6, 2026 17:34
Tao Cui added 4 commits October 7, 2026 16:20
The builtin linear cost model defines coefficients only for READ and
WRITE, so the flush component of IOs is priced at zero: standalone
flushes (the dataless REQ_OP_WRITE | REQ_PREFLUSH bios from
blkdev_issue_flush()) and the pre-flush the block layer issues ahead of
data-bearing REQ_PREFLUSH bios are both free.  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, monopolizing the device 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.

A flush is not like a write and the write coefficients say nothing
about what it costs, so instead of pricing it off them, add a flushiops
entry to io.cost.model, following the existing iops parameters: it sets
the rate at which flushes are charged, LCOEF_FLUSH =
VTIME_PER_SEC / flushiops.  The linear model cannot express how the
cost of a flush depends on the preceding writes, so this is a
per-request policy charge: a user-tunable knob rather than a hardware
property.  A bio with REQ_PREFLUSH is charged one flush on top of its
data cost, and a bio with REQ_FUA one more flush on devices without
native FUA support.  Zero (the default and the builtin profiles) means
no charge, so nothing changes until the parameter is configured.

Also skip the iocg->cursor update for dataless bios: they only reach it
once priced, and their bi_sector is not a data position, so setting
the cursor from it would misclassify the following IOs.

Signed-off-by: Tao Cui <cuitao@kylinos.cn>
Acked-by: Tejun Heo <tj@kernel.org>
Zone append is a primary write operation for zoned devices; zoned xfs
and btrfs use it for data writes.  It is priced at zero, so the zone
append portion of zoned workloads runs outside the controller: a
1%-weight cgroup issued 16000 appends at zero cost on a zoned null_blk.

Treat REQ_OP_ZONE_APPEND the same as REQ_OP_WRITE so it goes through
the existing seq/rand classification and charging.

Fixes: 0512a75 ("block: Introduce REQ_OP_ZONE_APPEND")
Signed-off-by: Tao Cui <cuitao@kylinos.cn>
Acked-by: Tejun Heo <tj@kernel.org>
ioc_rqos_done() only accounts READ and WRITE completions, so zone
append completions are excluded from the latency window: the vrate
feedback loop cannot see ZA-induced latency, leaving it unable to
respond to device saturation caused by zone appends.  Similarly,
calc_size_vtime_cost_builtin() does not classify zone append as a
write operation.

Charging (the cost model) and feedback (the latency window) are
separate mechanisms, so this is not covered by the previous patch
that prices zone appends.

Treat zone append as WRITE for both latency accounting and cost
classification.

Fixes: 0512a75 ("block: Introduce REQ_OP_ZONE_APPEND")
Signed-off-by: Tao Cui <cuitao@kylinos.cn>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Tejun Heo <tj@kernel.org>
The comment says that priority-inversion IOs are "punted to
@ioc->aux_iocg", but no aux_iocg field ever existed in struct ioc.
The comment was introduced already stale by commit da437b9
("blk-iocost: grab ioc->lock for debt handling").  Update it to
describe the current use_debt / iocg->abs_vdebt mechanism.

Signed-off-by: Tao Cui <cuitao@kylinos.cn>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Tejun Heo <tj@kernel.org>
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 7b63ef2
series: https://patchwork.kernel.org/series/1170993/
version: 4

@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1160080=>linus-master branch from ed5d608 to c42fcb8 Compare October 7, 2026 16:20
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 7b63ef2
series: https://patchwork.kernel.org/series/1170993/
version: 4

1 similar comment
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 7b63ef2
series: https://patchwork.kernel.org/series/1170993/
version: 4

@blktests-ci-kpd

Copy link
Copy Markdown
Author

Github failed to update this PR after force push. Close it.

@blktests-ci-kpd blktests-ci-kpd Bot closed this Oct 8, 2026
@blktests-ci-kpd
blktests-ci-kpd Bot deleted the series/1160080=>linus-master branch October 10, 2026 04:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants