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

Vincent Fu <[email protected]> Tue, 3 Mar 2026 19:14:24 -0500
Newsgroups org.kernel.vger.fio
Message-ID <CAOp=CXmVLq=a0OHdUVSxXPbaM6eK4FSxEL8_JMWmh+Amw4upRA@mail.gmail.com>
Applied. Thanks.

Vincent

On Mon, Mar 2, 2026 at 8:32=E2=80=AFPM Shin'ichiro Kawasaki
<[email protected]> wrote:
>
> When random write workload runs with zonemode=3Dzbd 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 v3:
> - 2nd patch: reflected review comments and added Reviewed-by tag
> - 3rd patch: fixed conflicts related to FIO_SERVER_VER and the 2nd patch =
change
> - Link to v3: https://lore.kernel.org/fio/20260302022609.3526823-1-shinic=
[email protected]/
>
> Changes from v2:
> - 2nd patch: improved the commit message to explain which workloads
>              remove zones from write target zones array
> - 4th patch: reflected review comments
> - Added Reviewed-by tags
> - Link to v2: https://lore.kernel.org/fio/20260216075936.3318729-1-shinic=
[email protected]/
>
> 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-shinic=
[email protected]/
>
>
> 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                         | 81 ++++++++++++++++++++++++++---------
>  10 files changed, 181 insertions(+), 31 deletions(-)
>
> --
> 2.49.0
>