diff mbox series

[blktests,4/5] zbd/005: Enable zonemode=zbd when zone capacity is less than zone size

Message ID 20200728101452.19309-5-shinichiro.kawasaki@wdc.com (mailing list archive)
State New, archived
Headers show
Series Support zone capacity | expand

Commit Message

Shin'ichiro Kawasaki July 28, 2020, 10:14 a.m. UTC
The test case zbd/005 runs fio to issue sequential write requests with
high queue depth. This workload does not require zonemode=zbd for zones
with zone capacity same as zone length. However, when the zone has
smaller zone capacity than zone size, it issues write beyond zone
capacity and triggers write errors.

To allow fio skipping the writes beyond zone capacity, specify the option
zonemode=zbd to fio when the test target zone has zone capacity smaller
than zone size.

Also remove unused sysfs access in the test case.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
---
 tests/zbd/005 | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

Comments

Johannes Thumshirn July 28, 2020, 10:47 a.m. UTC | #1
Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Klaus Jensen July 28, 2020, 7:20 p.m. UTC | #2
On Jul 28 19:14, Shin'ichiro Kawasaki wrote:
> The test case zbd/005 runs fio to issue sequential write requests with
> high queue depth. This workload does not require zonemode=zbd for zones
> with zone capacity same as zone length. However, when the zone has
> smaller zone capacity than zone size, it issues write beyond zone
> capacity and triggers write errors.
> 
> To allow fio skipping the writes beyond zone capacity, specify the option
> zonemode=zbd to fio when the test target zone has zone capacity smaller
> than zone size.
> 
> Also remove unused sysfs access in the test case.
> 
> Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
> ---

LGTM.

Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
diff mbox series

Patch

diff --git a/tests/zbd/005 b/tests/zbd/005
index 65546a6..1e8962c 100755
--- a/tests/zbd/005
+++ b/tests/zbd/005
@@ -28,15 +28,21 @@  cleanup_fallback_device() {
 test_device() {
 	local -i zone_idx
 	local -i offset
+	local zbdmode=""
 
 	echo "Running ${TEST_NAME}"
 
-	_get_sysfs_variable "${TEST_DEV}" || return $?
 	_get_blkzone_report "${TEST_DEV}" || return $?
 
 	zone_idx=$(_find_first_sequential_zone) || return $?
 	offset=$((ZONE_STARTS[zone_idx] * 512))
 
+	# If the test target zone has smaller zone capacity than zone size,
+	# enable zonemode=zbd to have fio handle the zone capacity limit.
+	if ((ZONE_CAPS[zone_idx] != ZONE_LENGTHS[zone_idx])); then
+		zbdmode="--zonemode=zbd"
+	fi
+
 	blkzone reset -o "${ZONE_STARTS[zone_idx]}" "${TEST_DEV}"
 
 	_test_dev_queue_set scheduler deadline
@@ -45,10 +51,9 @@  test_device() {
 	FIO_PERF_FIELDS=("write io" "write iops")
 	_fio_perf --filename="${TEST_DEV}" --name zbdwo --rw=write --direct=1 \
 		  --ioengine=libaio --iodepth=128 --bs=256k \
-		  --offset="${offset}"
+		  --offset="${offset}" ${zbdmode}
 
 	_put_blkzone_report
-	_put_sysfs_variable
 
 	echo "Test complete"
 }