From: "Wang Jianchao (Kuaishou)" <jianchao.wan9@gmail.com>
To: osandov@osandov.com
Cc: chaitanyak@nvidia.com, linux-block@vger.kernel.org
Subject: [RFC V2 blktests] test/block/032: add test cases for switching queue qos
Date: Thu, 17 Feb 2022 11:27:04 +0800 [thread overview]
Message-ID: <20220217032704.99150-1-jianchao.wan9@gmail.com> (raw)
Add test case for switching rq qos policy while doing IO. It will
select a exist policy randomly to close and open it every round.
Signed-off-by: Wang Jianchao (Kuaishou) <jianchao.wan9@gmail.com>
---
tests/block/032 | 62 +++++++++++++++++++++++++++++++++++++++++++++
tests/block/032.out | 2 ++
2 files changed, 64 insertions(+)
create mode 100644 tests/block/032
create mode 100644 tests/block/032.out
diff --git a/tests/block/032 b/tests/block/032
new file mode 100644
index 0000000..aaecc75
--- /dev/null
+++ b/tests/block/032
@@ -0,0 +1,62 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-3.0+
+# Copyright (C) 2022 Wang Jianchao
+#
+# Threads doing IO to a device, while we switch rqos
+
+. tests/block/rc
+
+DESCRIPTION="switch rqos while doing IO"
+TIMED=1
+CAN_BE_ZONED=1
+
+requires() {
+ _have_fio
+}
+
+test_device() {
+ echo "Running ${TEST_NAME}"
+
+ local rqos=("blk-wbt" "blk-iolat" "blk-iocost" "blk-ioprio")
+
+ if _test_dev_is_rotational; then
+ size="32m"
+ else
+ size="1g"
+ fi
+
+ # start fio job
+ _run_fio_rand_io --filename="$TEST_DEV" --size="$size" &
+
+ start_time=$(date +%s)
+ timeout=${TIMEOUT:=900}
+ while kill -0 $! 2>/dev/null; do
+ idx=$((RANDOM % ${#rqos[@]}))
+ pol=${rqos[$idx]}
+ cat ${TEST_DEV_SYSFS}/queue/qos | grep "\[$pol\]" > /dev/null
+ if [ $? -eq 0 ];then
+ echo "-$pol" > ${TEST_DEV_SYSFS}/queue/qos
+ if [ $? -ne 0 ];then
+ echo "$pol"
+ cat ${TEST_DEV_SYSFS}/queue/qos
+ fi
+ else
+ echo "+$pol" > ${TEST_DEV_SYSFS}/queue/qos
+ if [ $? -ne 0 ];then
+ echo "$pol"
+ cat ${TEST_DEV_SYSFS}/queue/qos
+ fi
+ fi
+ sleep .2
+ end_time=$(date +%s)
+ if (( end_time - start_time > timeout + 15 )); then
+ echo "fio did not finish after $timeout seconds!"
+ break
+ fi
+ done
+
+ FIO_PERF_FIELDS=("read iops")
+ _fio_perf_report
+
+ echo "Test complete"
+}
diff --git a/tests/block/032.out b/tests/block/032.out
new file mode 100644
index 0000000..3604e9e
--- /dev/null
+++ b/tests/block/032.out
@@ -0,0 +1,2 @@
+Running block/032
+Test complete
--
2.17.1
reply other threads:[~2022-02-17 3:28 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20220217032704.99150-1-jianchao.wan9@gmail.com \
--to=jianchao.wan9@gmail.com \
--cc=chaitanyak@nvidia.com \
--cc=linux-block@vger.kernel.org \
--cc=osandov@osandov.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;
as well as URLs for NNTP newsgroup(s).