Re: [PATCH v2 1/4] blk-iocost: charge flushes as pageless random writes

From: Tejun Heo

Date: Sat Sep 19 2026 - 11:01:09 EST


Hello, Tao.

On Wed, Sep 16, 2026 at 04:53:01PM +0800, Tao Cui wrote:
> Charge the flush component of any REQ_PREFLUSH bio on top of its data
> cost, priced as a pageless random write (LCOEF_WRANDIO), which provides
> an approximation of the device time consumed by a flush. For profiles
> where WRANDIO clamps to zero (ssd_dfl / ssd_fast), use a one-page floor
> (LCOEF_WPAGE).

Pricing a flush as a random write, or as a page where that comes out to
zero, is as arbitrary as pricing it at zero, and it changes what existing
setups get charged. 013adcbef165 ("blk-iocost: skip empty flush bio in
iocost") zeroed them because the flush machinery coalesces flushes and the
write coefficients don't say anything about what a flush costs.

Can you instead add the flushiops parameter you mentioned in the v1 thread
to the linear model? A flush costs VTIME_PER_SEC / flushiops, and zero when
the parameter isn't set, including in the builtin profiles, so nothing
changes until it's configured or the profiles are regenerated with a flush
measurement.

The same charge should cover REQ_FUA the way the flush machinery does: one
flush for PREFLUSH, and one for FUA on a device without FUA support, which
is when a post-flush gets issued.

Please also drop the Fixes tag on this patch. With the parameter, this is
an extension rather than a fix.

Thanks.

--
tejun