Re: [PATCH v2 1/8] zbd: fix zone selection of random writes

Damien Le Moal <[email protected]> Fri, 27 Feb 2026 13:48:29 +0900
Newsgroups org.kernel.vger.fio
Organization Western Digital Research
Message-ID <[email protected]>
On 2/16/26 16:59, Shin'ichiro Kawasaki wrote:
> In zonemode=zbd, random write workloads targeting zoned block devices
> with max write zones limits such as max_open_zones can not do write
> operations to randomly chosen offset because of the zoned block device
> constraint of writing at write pointers. To adjust the offsets to valid
> positions, fio calls the function zbd_convert_to_write_zone(). This
> function checks the current write target zones as the next offset
> candidates but may fail depending on the conditions of those zones.
> In such cases, the function waits for zone condition changes before
> retrying.
> 
> However, the retry logic begins with the zone where the previous attempt
> ended, and selects the zones that were previously write target.
> Consequently, the same zones are repeatedly chosen for writing,
> resulting in writes concentrating on certain zones despite the workload
> specifying random write.
> 
> To ensure proper zone selection for random writes, modify
> zbd_convert_to_write_zone() to retry the zone selection based on the
> original offset provided to the function. The local variable 'zb' keeps
> the reference to the zone corresponding to the original offset. Use 'zb'
> at the retry attempt start.
> 
> Signed-off-by: Shin'ichiro Kawasaki <[email protected]>

Looks good to me.

Reviewed-by: Damien Le Moal <[email protected]>

-- 
Damien Le Moal
Western Digital Research