From: Luis Chamberlain <mcgrof@kernel.org>
To: shinichiro.kawasaki@wdc.com
Cc: linux-block@vger.kernel.org, hare@suse.de,
patches@lists.linux.dev, gost.dev@samsung.com, mcgrof@kernel.org
Subject: [PATCH blktests v2 3/4] tests: use test device min io to support bs > ps
Date: Tue, 4 Feb 2025 14:57:28 -0800 [thread overview]
Message-ID: <20250204225729.422949-4-mcgrof@kernel.org> (raw)
In-Reply-To: <20250204225729.422949-1-mcgrof@kernel.org>
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@kernel.org>
---
tests/block/003 | 4 +++-
tests/block/007 | 3 ++-
tests/nvme/049 | 8 ++++++--
3 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/tests/block/003 b/tests/block/003
index 2af9b89ec3e5..d59f2eadd465 100755
--- a/tests/block/003
+++ b/tests/block/003
@@ -18,10 +18,12 @@ device_requires() {
}
test_device() {
+ local 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..8d4ee0758b12 100755
--- a/tests/block/007
+++ b/tests/block/007
@@ -31,13 +31,14 @@ cleanup_fallback_device() {
}
run_fio_job() {
+ local 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..77bb4daf5b08 100755
--- a/tests/nvme/049
+++ b/tests/nvme/049
@@ -19,10 +19,12 @@ test_device() {
echo "Running ${TEST_NAME}"
local ngdev=${TEST_DEV/nvme/ng}
+ local test_dev_bs=$(_min_io $ngdev)
+ local target_size=4096
local common_args=(
--size=1M
--filename="$ngdev"
- --bs=4k
+ --bs=$test_dev_bs
--rw=randread
--numjobs=1
--iodepth=16
@@ -34,8 +36,10 @@ test_device() {
)
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
next prev parent reply other threads:[~2025-02-04 22:57 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-04 22:57 [PATCH blktests v2 0/4] enable bs > ps device testing Luis Chamberlain
2025-02-04 22:57 ` [PATCH blktests v2 1/4] common: add and use min io for fio Luis Chamberlain
2025-02-07 11:26 ` Shinichiro Kawasaki
2025-02-07 20:47 ` Luis Chamberlain
2025-02-04 22:57 ` [PATCH blktests v2 2/4] common/xfs: use min io for fs blocksize Luis Chamberlain
2025-02-04 22:57 ` Luis Chamberlain [this message]
2025-02-04 22:57 ` [PATCH blktests v2 4/4] common/xfs: check for max supported sector size Luis Chamberlain
2025-02-07 11:58 ` Shinichiro Kawasaki
2025-02-07 20:46 ` Luis Chamberlain
2025-02-07 11:24 ` [PATCH blktests v2 0/4] enable bs > ps device testing Shinichiro Kawasaki
2025-02-10 15:32 ` Luis Chamberlain
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250204225729.422949-4-mcgrof@kernel.org \
--to=mcgrof@kernel.org \
--cc=gost.dev@samsung.com \
--cc=hare@suse.de \
--cc=linux-block@vger.kernel.org \
--cc=patches@lists.linux.dev \
--cc=shinichiro.kawasaki@wdc.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox