Skip to contentSkip to conversation

Recent changes (master)

PATCH Jens Axboe 1 participant 1 message Jan 30, 2021 Kbuild

lore
Share & tools
lore

Jens Axboe

author
#0 lore raw

The following changes since commit 119bb82143bd6c4a577c135ece4ed6b702443f50:

Merge branch 'fio-fix-detecting-libpmem' of https://github.com/ldorau/fio (2021-01-27 09:51:01 -0700)

are available in the Git repository at:

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

for you to fetch changes up to 2ef3c1b02473a14bf7b8b52e28d0cdded9c5cc9a:

zbd: relocate Coverity annotation (2021-01-29 22:06:49 -0700)

----------------------------------------------------------------
Aravind Ramesh (1):
zbd: initialize sectors with data at start time

Dmitry Fomichev (26):
zbd: return ENOMEM if zone buffer allocation fails
zbd: use zbd_zone_nr() more actively in the code
zbd: add get_zone() helper function
zbd: introduce zone_unlock()
zbd: engines/libzbc: don't fail on assert for offline zones
zbd: remove dependency on zone type during i/o
zbd: skip offline zones in zbd_convert_to_open_zone()
zbd: avoid zone buffer overrun
zbd: don't unlock zone mutex after verify replay
zbd: use zone_lock() in zbd_process_swd()
zbd: don't log "zone nnnn is not open" message
zbd: handle conventional start zone in zbd_convert_to_open_zone()
zbd: improve replay range validation
engines/libzbc: enable block backend
zbd: avoid failing assertion in zbd_convert_to_open_zone()
zbd: set thread errors in zbd_adjust_block()
t/zbd: check for error in test #2
t/zbd: add run-tests-against-nullb script
t/zbd: add an option to bail on a failed test
t/zbd: prevent test #31 from looping
t/zbd: add checks for offline zone condition
t/zbd: add test #54 to exercise ZBD verification t/zbd: show elapsed time in test-zbd-support
t/zbd: increase timeout in test #48
t/zbd: avoid looping on invalid command line options
zbd: relocate Coverity annotation

Jens Axboe (1):
zbd: fix 32-bit compile warnings for logging

Shin'ichiro Kawasaki (12):
zbd: do not lock conventional zones on I/O adjustment
zbd: do not set zbd handlers for conventional zones
zbd: count sectors with data for write pointer zones
zbd: initialize min_zone and max_zone for all zone types
zbd: disable crossing from conventional to sequential zones t/zbd: add -t option to run-tests-against-nullb
t/zbd: skip tests when test prerequisites are not met t/zbd: skip tests that need too many sequential zones t/zbd: test that conventional zones are not locked during random i/o t/zbd: test that zone_reset_threshold calculation is correct t/zbd: test random I/O direction in all-conventional case t/zbd: fix wrong units in test case #37

 Makefile                              |   5 +-
 engines/libzbc.c                      |   5 +-
 oslib/linux-blkzoned.c                |   2 +-
 t/run-fio-tests.py                    |   8 +-
 t/zbd/functions                       |  56 +++++-
 t/zbd/run-tests-against-nullb         | 354 +++++++++++++++++++++++++++++++++
 t/zbd/run-tests-against-regular-nullb |  27 ---
 t/zbd/run-tests-against-zoned-nullb   |  53 -----
 t/zbd/test-zbd-support                | 299 ++++++++++++++++++++++++----
 zbd.c                                 | 357 +++++++++++++++++++++-------------
 zbd.h                                 |   5 +
 11 files changed, 911 insertions(+), 260 deletions(-)
 create mode 100755 t/zbd/run-tests-against-nullb
 delete mode 100755 t/zbd/run-tests-against-regular-nullb
 delete mode 100755 t/zbd/run-tests-against-zoned-nullb

---

Diff of recent changes:

Makefile +3 -2
index f74e59e1..612344d1 100644
@@ -626,9 +626,10 @@ fulltest:
 	   make -j &&						 	\
 	   sudo make install)						\
 	fi &&					 			\
-	sudo t/zbd/run-tests-against-regular-nullb &&		 	\
+	sudo t/zbd/run-tests-against-nullb -s 1 &&		 	\
 	if [ -e /sys/module/null_blk/parameters/zoned ]; then		\
-		sudo t/zbd/run-tests-against-zoned-nullb;	 	\
+		sudo t/zbd/run-tests-against-nullb -s 2;	 	\
+		sudo t/zbd/run-tests-against-nullb -s 4;	 	\
 	fi
 
 install: $(PROGS) $(SCRIPTS) $(ENGS_OBJS) tools/plot/fio2gnuplot.1 FORCE
engines/libzbc.c +3 -2
index 4b900233..2aacf7bb 100644
@@ -86,7 +86,8 @@ static int libzbc_open_dev(struct thread_data *td, struct fio_file *f,
 		return -ENOMEM;
 
 	ret = zbc_open(f->file_name,
-		       flags | ZBC_O_DRV_SCSI | ZBC_O_DRV_ATA, &ld->zdev);
+		       flags | ZBC_O_DRV_BLOCK | ZBC_O_DRV_SCSI | ZBC_O_DRV_ATA,
+		       &ld->zdev);
 	if (ret) {
 		log_err("%s: zbc_open() failed, err=%d\n",
 			f->file_name, ret);
@@ -283,7 +284,7 @@ static int libzbc_report_zones(struct thread_data *td, struct fio_file *f,
 		default:
 			/* Treat all these conditions as offline (don't use!) */
 			zbdz->cond = ZBD_ZONE_COND_OFFLINE;
-			break;
+			zbdz->wp = zbdz->start;
 		}
 	}
 
oslib/linux-blkzoned.c +1 -1
index 0a8a577a..f37c67fc 100644
@@ -203,7 +203,7 @@ int blkzoned_report_zones(struct thread_data *td, struct fio_file *f,
 		default:
 			/* Treat all these conditions as offline (don't use!) */
 			z->cond = ZBD_ZONE_COND_OFFLINE;
-			break;
+			z->wp = z->start;
 		}
 	}
 
t/run-fio-tests.py +4 -4
index e5c2f17c..a59cdfe0 100755
@@ -879,8 +879,8 @@ TEST_LIST = [
     {
         'test_id':          1007,
         'test_class':       FioExeTest,
-        'exe':              't/zbd/run-tests-against-regular-nullb',
-        'parameters':       None,
+        'exe':              't/zbd/run-tests-against-nullb',
+        'parameters':       ['-s', '1'],
         'success':          SUCCESS_DEFAULT,
         'requirements':     [Requirements.linux, Requirements.zbd,
                              Requirements.root],
@@ -888,8 +888,8 @@ TEST_LIST = [
     {
         'test_id':          1008,
         'test_class':       FioExeTest,
-        'exe':              't/zbd/run-tests-against-zoned-nullb',
-        'parameters':       None,
+        'exe':              't/zbd/run-tests-against-nullb',
+        'parameters':       ['-s', '2'],
         'success':          SUCCESS_DEFAULT,
         'requirements':     [Requirements.linux, Requirements.zbd,
                              Requirements.root, Requirements.zoned_nullb],
t/zbd/functions +54 -2

74 lines not on this page · raw message

t/zbd/run-tests-against-nullb new file +354 -0

354 lines not on this page · raw message

t/zbd/run-tests-against-regular-nullb deleted +0 -27
deleted file mode 100755
index 5b7b4009..00000000
@@ -1,27 +0,0 @@
-#!/bin/bash
-#
-# Copyright (C) 2018 Western Digital Corporation or its affiliates.
-#
-# This file is released under the GPL.
-
-scriptdir="$(cd "$(dirname "$0")" && pwd)"
-
-for d in /sys/kernel/config/nullb/*; do [ -d "$d" ] && rmdir "$d"; done
-modprobe -r null_blk
-modprobe null_blk nr_devices=0 || exit $?
-for d in /sys/kernel/config/nullb/*; do
-    [ -d "$d" ] && rmdir "$d"
-done
-modprobe -r null_blk
-[ -e /sys/module/null_blk ] && exit $?
-modprobe null_blk nr_devices=0 &&
-    cd /sys/kernel/config/nullb &&
-    mkdir nullb0 &&
-    cd nullb0 &&
-    echo 0 > completion_nsec &&
-    echo 4096 > blocksize &&
-    echo 1024 > size &&
-    echo 1 > memory_backed &&
-    echo 1 > power || exit $?
-
-"${scriptdir}"/test-zbd-support "$@" /dev/nullb0
t/zbd/run-tests-against-zoned-nullb deleted +0 -53

53 lines not on this page · raw message

t/zbd/test-zbd-support +262 -37

515 lines not on this page · raw message

zbd.c +225 -132

791 lines not on this page · raw message

zbd.h +5 -0
index bff55f99..cc3ab624 100644
@@ -28,6 +28,7 @@ enum io_u_action {
  * @mutex: protects the modifiable members in this structure
  * @type: zone type (BLK_ZONE_TYPE_*)
  * @cond: zone state (BLK_ZONE_COND_*)
+ * @has_wp: whether or not this zone can have a valid write pointer
  * @open: whether or not this zone is currently open. Only relevant if
  *		max_open_zones > 0.
  * @reset_zone: whether or not this zone should be reset before writing to it
@@ -40,6 +41,7 @@ struct fio_zone_info {
 	uint32_t		verify_block;
 	enum zbd_zone_type	type:2;
 	enum zbd_zone_cond	cond:4;
+	unsigned int		has_wp:1;
 	unsigned int		open:1;
 	unsigned int		reset_zone:1;
 };
@@ -53,6 +55,8 @@ struct fio_zone_info {
  *		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
  * @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
@@ -73,6 +77,7 @@ struct zoned_block_device_info {
 	pthread_mutex_t		mutex;
 	uint64_t		zone_size;
 	uint64_t		sectors_with_data;
+	uint64_t		wp_sectors_with_data;
 	uint32_t		zone_size_log2;
 	uint32_t		nr_zones;
 	uint32_t		refcount;