Skip to contentSkip to conversation

blktests: add a test for wbt

PATCH In review Josef Bacik 2 participants 2 messages Dec 12, 2018 – Dec 19, 2018 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 blktests: add a test for wbt

There's currently no tests to verify wbt is working properly, this patch fixes that. Simply run a varied workload and measure the read latencies with wbt off, and then turn it on and verify that the read latencies go down.

---
 common/fio          |  8 +++++
 common/rc           |  8 +++++
 tests/block/022     | 94 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/block/022.out |  2 ++
 tests/block/026     | 12 ++-----
 5 files changed, 114 insertions(+), 10 deletions(-)
 create mode 100755 tests/block/022
 create mode 100644 tests/block/022.out
common/fio +8 -0
index e407088840b8..9e1a0557ac61 100644
@@ -192,3 +192,11 @@ _fio_perf_report() {
 		TEST_RUN["$FIO_PERF_PREFIX$name"]="$value"
 	done
 }
+
+_fio_results_key() {
+	local job=$1
+	local key=$2
+	local resultfile=$3
+
+	jq '.jobs[] | select(.jobname == "'"$job"'") | .'"$key" "$resultfile"
+}
common/rc +8 -0
index 153a32358519..91972d7b0130 100644
@@ -183,6 +183,14 @@ _test_dev_is_pci() {
 	return 0
 }
 
+_test_dev_supports_wbt() {
+	if [[ ! -e "${TEST_DEV_SYSFS}/queue/wbt_lat_usec" ]]; then
+		SKIP_REASON="$TEST_DEV does not support wbt"
+		return 1
+	fi
+	return 0
+}
+
 _get_pci_dev_from_blkdev() {
 	readlink -f "$TEST_DEV_SYSFS/device" | \
 		grep -Eo '[0-9a-f]{4,5}:[0-9a-f]{2}:[0-9a-f]{2}\.[0-9a-f]' | \
tests/block/022 new file +94 -0

94 lines not on this page · raw message

tests/block/022.out new file +2 -0
new file mode 100644
index 000000000000..14d43cb1c828
@@ -0,0 +1,2 @@
+Running block/022
+Test complete
tests/block/026 +2 -10
index 88113a99bd28..8b18e6314d5e 100644
@@ -14,21 +14,13 @@ requires() {
 		_have_program jq
 }
 
-fio_results_key() {
-	local job=$1
-	local key=$2
-	local resultfile=$3
-
-	jq '.jobs[] | select(.jobname == "'"$job"'") | .'"$key" "$resultfile"
-}
-
 sum_read_write_bytes() {
 	local job=$1
 	local resultfile=$2
 	local readbytes writebytes
 
-	readbytes=$(fio_results_key "$job" read.io_bytes "$resultfile")
-	writebytes=$(fio_results_key "$job" write.io_bytes "$resultfile")
+	readbytes=$(_fio_results_key "$job" read.io_bytes "$resultfile")
+	writebytes=$(_fio_results_key "$job" write.io_bytes "$resultfile")
 	echo $((readbytes + writebytes))
 }
 
Signature · 1 line
2.14.3
#1 lore raw
Quoted 6 lines · Josef Bacik

There's currently no tests to verify wbt is working properly, this patch fixes that. Simply run a varied workload and measure the read latencies with wbt off, and then turn it on and verify that the read latencies go down.

Similar to the io.latency test. Test itself looks fine, but sometimes fails with "Read latency too high, wbt not working?". Maybe these tests just aren't well suited for running in QEMU?