All of lore.kernel.org
 help / color / mirror / Atom feed
* [[RFC blktests]] test/block/032: add test cases for switching queue qos
@ 2022-02-16 11:59 Wang Jianchao (Kuaishou)
  2022-02-16 17:34 ` Chaitanya Kulkarni
  0 siblings, 1 reply; 3+ messages in thread
From: Wang Jianchao (Kuaishou) @ 2022-02-16 11:59 UTC (permalink / raw)
  To: osandov; +Cc: chaitanyak, linux-block

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..bb10506
--- /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=("wbt" "iolat" "iocost" "io-prio")
+
+	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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [[RFC blktests]] test/block/032: add test cases for switching queue qos
  2022-02-16 11:59 [[RFC blktests]] test/block/032: add test cases for switching queue qos Wang Jianchao (Kuaishou)
@ 2022-02-16 17:34 ` Chaitanya Kulkarni
  2022-02-17  3:00   ` Wang Jianchao
  0 siblings, 1 reply; 3+ messages in thread
From: Chaitanya Kulkarni @ 2022-02-16 17:34 UTC (permalink / raw)
  To: Wang Jianchao (Kuaishou); +Cc: linux-block, osandov

On 2/16/22 03:59, Wang Jianchao (Kuaishou) wrote:
> 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


Can you please add some comments to make it easier to read for someone
who's new to the blktests framework ?

-ck



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [[RFC blktests]] test/block/032: add test cases for switching queue qos
  2022-02-16 17:34 ` Chaitanya Kulkarni
@ 2022-02-17  3:00   ` Wang Jianchao
  0 siblings, 0 replies; 3+ messages in thread
From: Wang Jianchao @ 2022-02-17  3:00 UTC (permalink / raw)
  To: Chaitanya Kulkarni; +Cc: linux-block, osandov



On 2022/2/17 1:34 上午, Chaitanya Kulkarni wrote:
> On 2/16/22 03:59, Wang Jianchao (Kuaishou) wrote:
>> 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
> 
> 
> Can you please add some comments to make it easier to read for someone
> who's new to the blktests framework ?
> 

I will add some comment to explain what does the test case do in next version.

Thanks
Jianchao
 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-02-17  3:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-16 11:59 [[RFC blktests]] test/block/032: add test cases for switching queue qos Wang Jianchao (Kuaishou)
2022-02-16 17:34 ` Chaitanya Kulkarni
2022-02-17  3:00   ` Wang Jianchao

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.