Skip to contentSkip to conversation

Recent changes (master)

PATCH Jens Axboe 1 participant 1 message Feb 15, 2023

lore
Share & tools
lore

Jens Axboe

author
#0 lore raw

The following changes since commit b65023f3c8849e122b2a223838ae9fdaed994e84:

Merge branch 'msg-Modify_QD_Sync_Warning_For_offload' of https://github.com/horshack-dpreview/fio (2023-02-10 11:49:46 -0500)

are available in the Git repository at:

git://git.kernel.dk/fio.git master

for you to fetch changes up to 1bd16cf9c113fcf9d49cae07da50e8a5c7a784ee:

examples: update nbd.fio fiograph diagram (2023-02-14 10:47:50 -0500)

----------------------------------------------------------------
Richard W.M. Jones (1):
examples: Small updates to nbd.fio

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 setup t/zbd: add test cases for zone_reset_threshold option

Vincent Fu (1):
examples: update nbd.fio fiograph diagram

 HOWTO.rst              |   9 ++-
 examples/nbd.fio       |  28 ++++++----
 examples/nbd.png       | Bin 88667 -> 43251 bytes
 fio.1                  |   8 ++-
 t/zbd/test-zbd-support |  60 +++++++++++++++++++-
 zbd.c                  | 149 +++++++++++++++++++++++--------------------------
 zbd.h                  |  11 ++--
 7 files changed, 161 insertions(+), 104 deletions(-)

---

Diff of recent changes:

HOWTO.rst +6 -3
index 17caaf5d..158c5d89 100644
@@ -1085,9 +1085,12 @@ Target file/device
 
 .. option:: zone_reset_threshold=float
 
-	A number between zero and one that indicates the ratio of logical
-	blocks with data to the total number of logical blocks in the test
-	above which zones should be reset periodically.
+	A number between zero and one that indicates the ratio of written bytes
+	in the zones with write pointers in the IO range to the size of the IO
+	range. When current ratio is above this ratio, zones are reset
+	periodically as :option:`zone_reset_frequency` specifies. If there are
+	multiple jobs when using this option, the IO range for all write jobs
+	has to be the same.
 
 .. option:: zone_reset_frequency=float
 
examples/nbd.fio +16 -12
index 6900ebe7..31629fad 100644
@@ -1,21 +1,25 @@
-# To use fio to test nbdkit:
+# To use fio to test nbdkit + RAM disk:
 #
-# nbdkit -U - memory size=256M --run 'export unixsocket; fio examples/nbd.fio'
+#   nbdkit -U - memory size=256M --run 'export uri; fio examples/nbd.fio'
 #
-# To use fio to test qemu-nbd:
+# To use fio to test nbdkit + local file:
 #
-# rm -f /tmp/disk.img /tmp/socket
-# truncate -s 256M /tmp/disk.img
-# export unixsocket=/tmp/socket
-# qemu-nbd -t -k $unixsocket -f raw /tmp/disk.img &
-# fio examples/nbd.fio
-# killall qemu-nbd
+#   rm -f /var/tmp/disk.img
+#   truncate -s 256M /var/tmp/disk.img
+#   nbdkit -U - file /var/tmp/disk.img --run 'export uri; fio examples/nbd.fio'
+#
+# To use fio to test qemu-nbd + local file:
+#
+#   rm -f /var/tmp/disk.img /var/tmp/socket
+#   truncate -s 256M /var/tmp/disk.img
+#   export uri='nbd+unix:///?socket=/var/tmp/socket'
+#   qemu-nbd -t -k /var/tmp/socket -f raw /var/tmp/disk.img &
+#   fio examples/nbd.fio
+#   killall qemu-nbd
 
 [global]
 ioengine=nbd
-uri=nbd+unix:///?socket=${unixsocket}
-# Starting from nbdkit 1.14 the following will work:
-#uri=${uri}
+uri=${uri}
 rw=randrw
 time_based
 runtime=60
examples/nbd.png binary +0 -0
index e3bcf610..3a933c9b 100644
Binary files a/examples/nbd.png and b/examples/nbd.png differ
fio.1 +5 -3
index 527b3d46..00a09353 100644
@@ -854,9 +854,11 @@ of the zoned block device in use, thus allowing the option \fBmax_open_zones\fR
 value to be larger than the device reported limit. Default: false.
 .TP
 .BI zone_reset_threshold \fR=\fPfloat
-A number between zero and one that indicates the ratio of logical blocks with
-data to the total number of logical blocks in the test above which zones
-should be reset periodically.
+A number between zero and one that indicates the ratio of written bytes in the
+zones with write pointers in the IO range to the size of the IO range. When
+current ratio is above this ratio, zones are reset periodically as
+\fBzone_reset_frequency\fR specifies. If there are multiple jobs when using this
+option, the IO range for all write jobs has to be the same.
 .TP
 .BI zone_reset_frequency \fR=\fPfloat
 A number between zero and one that indicates how often a zone reset should be
t/zbd/test-zbd-support +58 -2

72 lines not on this page · raw message

zbd.c +70 -79

231 lines not on this page · raw message

zbd.h +6 -5
index d425707e..05189555 100644
@@ -54,9 +54,9 @@ struct fio_zone_info {
  * @mutex: Protects the modifiable members in this structure (refcount and
  *		num_open_zones).
  * @zone_size: size of a single zone in bytes.
- * @sectors_with_data: total size of data in all zones in units of 512 bytes
- * @wp_sectors_with_data: total size of data in zones with write pointers in
- *                        units of 512 bytes
+ * @wp_valid_data_bytes: total size of data in zones with write pointers
+ * @write_min_zone: Minimum zone index of all job's write ranges. Inclusive.
+ * @write_max_zone: Maximum zone index of all job's write ranges. Exclusive.
  * @zone_size_log2: log2 of the zone size in bytes if it is a power of 2 or 0
  *		if the zone size is not a power of 2.
  * @nr_zones: number of zones
@@ -76,8 +76,9 @@ struct zoned_block_device_info {
 	uint32_t		max_open_zones;
 	pthread_mutex_t		mutex;
 	uint64_t		zone_size;
-	uint64_t		sectors_with_data;
-	uint64_t		wp_sectors_with_data;
+	uint64_t		wp_valid_data_bytes;
+	uint32_t		write_min_zone;
+	uint32_t		write_max_zone;
 	uint32_t		zone_size_log2;
 	uint32_t		nr_zones;
 	uint32_t		refcount;