[PATCH blktests v3 5/6] tests: use test device min io to support bs > ps

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When a block device supports a minimum block size > ps we must
ensure we don't issue IOs below what is supported. Just leverage
the min optimal IO to also ensure we use the optimal IO as well.

Signed-off-by: Luis Chamberlain <mcgrof@xxxxxxxxxx>
---
 tests/block/003 |  6 +++++-
 tests/block/007 |  5 ++++-
 tests/nvme/049  | 15 +++++++++++----
 3 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/tests/block/003 b/tests/block/003
index 2af9b89ec3e5..b0dd1d1fd62b 100755
--- a/tests/block/003
+++ b/tests/block/003
@@ -18,10 +18,14 @@ device_requires() {
 }
 
 test_device() {
+	local test_dev_bs
+
+	test_dev_bs=$(_min_io "$TEST_DEV")
+
 	echo "Running ${TEST_NAME}"
 
 	FIO_PERF_FIELDS=("trim iops")
-	_fio_perf --bsrange=4k-4g --rw=randtrim --norandommap --name=discards \
+	_fio_perf --bsrange="${test_dev_bs}"-4g --rw=randtrim --norandommap --name=discards \
 		--filename="$TEST_DEV" --number_ios=200k
 
 	echo "Test complete"
diff --git a/tests/block/007 b/tests/block/007
index 3b68d0deec35..8043a83a565b 100755
--- a/tests/block/007
+++ b/tests/block/007
@@ -31,13 +31,16 @@ cleanup_fallback_device() {
 }
 
 run_fio_job() {
+	local test_dev_bs
+
+	test_dev_bs=$(_min_io "$TEST_DEV")
 	if _test_dev_is_rotational; then
 		size="32m"
 	else
 		size="1g"
 	fi
 
-	_fio_perf --bs=4k --rw=randread --norandommap --name=reads \
+	_fio_perf --bs="$test_dev_bs" --rw=randread --norandommap --name=reads \
 		--filename="$TEST_DEV" --size="$size" --direct=1 \
 		--ioengine=pvsync2 --hipri="$1"
 }
diff --git a/tests/nvme/049 b/tests/nvme/049
index 88d4fb122988..7304d6604d8f 100755
--- a/tests/nvme/049
+++ b/tests/nvme/049
@@ -19,10 +19,16 @@ test_device() {
 	echo "Running ${TEST_NAME}"
 
 	local ngdev=${TEST_DEV/nvme/ng}
-	local common_args=(
+	local test_dev_bs
+	local target_size=4096
+	local common_args=()
+	local fio_output
+
+	test_dev_bs=$(_min_io "$ngdev")
+	common_args=(
 		--size=1M
 		--filename="$ngdev"
-		--bs=4k
+		--bs="$test_dev_bs"
 		--rw=randread
 		--numjobs=1
 		--iodepth=16
@@ -32,10 +38,11 @@ test_device() {
 		--time_based
 		--runtime=2
 	)
-	local fio_output
+
+	((test_dev_bs > target_size)) && target_size=$test_dev_bs
 
 	# check security permission
-	if ! fio_output=$(fio --name=check --size=4k --filename="$ngdev" \
+	if ! fio_output=$(fio --name=check --bs="$test_dev_bs" --size="$target_size" --filename="$ngdev" \
 			    --rw=read --ioengine=io_uring_cmd 2>&1) &&
 			grep -q -e "Operation not permitted" \
 				-e "Permission denied" <<< "$fio_output"; then
-- 
2.45.2





[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux