[PATCH v2 0/8] zbd: fix problems of random write with unaligned block size

Shin'ichiro Kawasaki
2026-02-16T08:00:46Z

When random write workload runs with zonemode=zbd and block size
unaligned to the zone size or the initial write pointer position, three
problems are observed. The first one is write target zone selection.
When one zone is filled by the write workload, the same zone is selected
as the next write target. This results in writes concentrating on
certain zones despite the workload specifies random write.

The second problem is wrong write target zone accounting. When a job
selects a zone for next write, another job might have removed the zone
from the write target zone under certain conditions.

The third problem is write performance. The writes with unaligned block
size leaves small remainder areas at the end of write target zones. To
free up the zone resource, current fio does zone finish operations to
the zones with the small remainder. Fio also calls io_u_quiesce() to
prepare for the zone finish operation and the write target zone
switching. These zone finish operation and io_u_quiesce() calls
significantly degrade the random write performance.

This series address these problems. The first two patches address the
first two problems respectively. The third patch introduces a new option
to address the performance problem. The last five patches adjust the
documentation and the test set for the new option introduced by the
third patch.

Changes from v1:
- Per discussion with Vincent, keep the current zone finish operation as
default and introduced the new option "write_zone_remainder".
- Dropped patches to remove codes for zone finish operation
- Moved "fix write zone accounting" patch from 4th to 2nd in the series
- Rebased to the latest master branch tip
- Link to v1: https://lore.kernel.org/fio/20260109023603.2848421-1-shinichiro.kawasaki@wdc.com/

Shin'ichiro Kawasaki (8):
zbd: fix zone selection of random writes
zbd: fix write zone accounting
zbd: introduce write_zone_remainder option
doc: explain the option write_zone_remainder
t/zbd: add -m option to enable write_zone_remainder option
t/zbd: avoid test case 14 failure with write_zone_remainder option
t/zbd: avoid test case 33 failure with write_zone_remainder option
t/zbd: avoid test case 71 failure with write_zone_remainder option

HOWTO.rst | 26 ++++++++++-
cconv.c | 2 +
fio.1 | 25 ++++++++--
init.c | 13 ++++++
options.c | 10 ++++
server.h | 2 +-
t/zbd/run-tests-against-nullb | 6 +++
t/zbd/test-zbd-support | 45 ++++++++++++++++--
thread_options.h | 2 +
zbd.c | 87 ++++++++++++++++++++++++++---------
10 files changed, 185 insertions(+), 33 deletions(-)

--
2.49.0