Re: [PATCH v2 2/4] blk-iocost: charge zone appends as page-counted sequential writes
From: Tejun Heo
Date: Sat Sep 19 2026 - 11:00:42 EST
Hello, Tao.
On Wed, Sep 16, 2026 at 04:53:02PM +0800, Tao Cui wrote:
> A zone append advances the zone write pointer and is therefore
> sequential from the device's perspective; the actual sector is only
> returned after completion, so the cursor-based seq/rand classification
> doesn't apply. Price it as a page-counted sequential write.
Whether an append is cheap depends on where the previous IO went, the same
as for a regular write, and the cursor already tracks that. The sector is
the zone start rather than the write pointer, but the cursor gets set from
the same sector, so back-to-back appends to the same zone are a bio length
apart and classify sequential, appends to different zones are a zone apart
and classify random, and emulated appends already arrive here as regular
writes at the write pointer.
It isn't exact. A read or regular write into a zone being appended to is
measured from the zone start rather than the write pointer, so it drifts
toward random as the zone fills, and the last append in one zone and the
first in the next are contiguous but compute as a zone apart. Both are
bounded by the difference between the seq and rand base costs of one IO,
which is small on the flash devices that do native appends. Mostly right
is fine here. Can you just add REQ_OP_ZONE_APPEND to the REQ_OP_WRITE case
and leave the cursor update alone?
Also, the Fixes tags on this patch and 3/4 should point at 0512a75b98f8
("block: Introduce REQ_OP_ZONE_APPEND"), which added the op without pricing
it, rather than the iocost commit that predates it.
Thanks.
--
tejun