fio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/8] zbd: fix 'sectors with data' and zone_reset_threshold accounting issues
@ 2023-02-07  6:37 Shin'ichiro Kawasaki
  2023-02-07  6:37 ` [PATCH v2 1/8] zbd: refer file->last_start[] instead of sectors with data accounting Shin'ichiro Kawasaki
                   ` (7 more replies)
  0 siblings, 8 replies; 20+ messages in thread
From: Shin'ichiro Kawasaki @ 2023-02-07  6:37 UTC (permalink / raw)
  To: fio, Jens Axboe, Vincent Fu
  Cc: Damien Le Moal, Niklas Cassel, Dmitry Fomichev, Shin'ichiro Kawasaki

When zonemode=zbd is specified, fio does 'sectors with data' accounting to
record the total number of sectors that have been written on a zoned block
device. This accounting has issues as follows:

Issue 1)
   The name 'sectors with data' indicates that the accounting uses 'sector' as
   the unit. However, it is implemented using 'byte' as the unit.

Issue 2)
   The accounting does not work correctly when multi-jobs with different IO
   ranges due to two reasons. One reason is the accounting field initialization.
   The accounting field is shared across all jobs, but it is initialized
   repeatedly by all jobs. This results in wrong behaviors except the last job.
   The second reason is definition difference between the zone_reset_threshold
   option and the accounting. The option is defined as the ratio of valid
   written data to the IO range of each job. However, the accounting is done
   per device and shared across all jobs. This coverage gap between each job's
   IO range and the accounting range causes unexpected zone reset.

Issue 3)
   Counting the total number of written sectors requires taking the zone lock of
   all zones in a job IO range. For a multi-job workload with overlapping IO
   ranges, this often leads to significant zone lock contention, resulting in
   some jobs starting IOs only after other jobs have completed their work
   (which looks like an apparent deadlock on startup).

This series addresses the issues with solutions as follows:

For Issue 1)
   Rephrase variables, comments and man pages to indicate that the accounting
   unit is not sector. -> 3rd and 4th patches

For Issue 2)
   Limit the condition of the accounting to ensure correct accounting. Do the
   accounting only when the zone_reset_threshold option is specified and all
   write jobs have the same IO range. Initialize the accounting field only once
   for the 1st job. -> 5th and 6th patches

For Issue 3)
   Move the total valid bytes counting code from "file reset" after job start
   to "file set up" before job start. This allows to count without zone locks,
   then avoids the lock contention. -> 7th patch

The first two patches are preparation patches to reduce references to the
'sectors with data' accounting field. The last 8th patch adds test cases for the
zone_reset_threshold option.

Changes from v1:
* Reworked not to change the definition of the zone_reset_threshold option
* Separated the patch to remove CHECK_SWD (or CHECK_VDB) to clarify the removal

Shin'ichiro Kawasaki (8):
  zbd: refer file->last_start[] instead of sectors with data accounting
  zbd: remove CHECK_SWD feature
  zbd: rename the accounting 'sectors with data' to 'valid data bytes'
  doc: fix unit of zone_reset_threshold and relation to other option
  zbd: account valid data bytes only for zone_reset_threshold option
  zbd: check write ranges for zone_reset_threshold option
  zbd: initialize valid data bytes accounting at file set up
  t/zbd: add test cases for zone_reset_threshold option

 HOWTO.rst              |   8 ++-
 fio.1                  |   8 ++-
 t/zbd/test-zbd-support |  60 +++++++++++++++++-
 zbd.c                  | 139 ++++++++++++++++++-----------------------
 zbd.h                  |  11 ++--
 5 files changed, 135 insertions(+), 91 deletions(-)

-- 
2.38.1


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2023-02-08  8:31 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-07  6:37 [PATCH v2 0/8] zbd: fix 'sectors with data' and zone_reset_threshold accounting issues Shin'ichiro Kawasaki
2023-02-07  6:37 ` [PATCH v2 1/8] zbd: refer file->last_start[] instead of sectors with data accounting Shin'ichiro Kawasaki
2023-02-07 14:05   ` Niklas Cassel
2023-02-07  6:37 ` [PATCH v2 2/8] zbd: remove CHECK_SWD feature Shin'ichiro Kawasaki
2023-02-07 14:05   ` Niklas Cassel
2023-02-07  6:37 ` [PATCH v2 3/8] zbd: rename the accounting 'sectors with data' to 'valid data bytes' Shin'ichiro Kawasaki
2023-02-07 14:06   ` Niklas Cassel
2023-02-07  6:37 ` [PATCH v2 4/8] doc: fix unit of zone_reset_threshold and relation to other option Shin'ichiro Kawasaki
2023-02-07 14:06   ` Niklas Cassel
2023-02-07  6:37 ` [PATCH v2 5/8] zbd: account valid data bytes only for zone_reset_threshold option Shin'ichiro Kawasaki
2023-02-07 14:06   ` Niklas Cassel
2023-02-07  6:37 ` [PATCH v2 6/8] zbd: check write ranges " Shin'ichiro Kawasaki
2023-02-07 14:06   ` Niklas Cassel
2023-02-08  4:59     ` Shinichiro Kawasaki
2023-02-07  6:37 ` [PATCH v2 7/8] zbd: initialize valid data bytes accounting at file set up Shin'ichiro Kawasaki
2023-02-07 14:06   ` Niklas Cassel
2023-02-08  5:03     ` Shinichiro Kawasaki
2023-02-08  8:30       ` Niklas Cassel
2023-02-07  6:37 ` [PATCH v2 8/8] t/zbd: add test cases for zone_reset_threshold option Shin'ichiro Kawasaki
2023-02-07 14:06   ` Niklas Cassel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).