[PATCH blktests 3/5] tests/nvmeof-mp/012: fix the schedulers list
Yi Zhang
yi.zhang at redhat.com
Mon Nov 23 20:04:25 EST 2020
There is no cfg scheduler and new added kyber scheduler in lastest kernel,
so get the scheduler from sysfs
To reproduce it:
$ ./check nvmeof-mp/012
nvmeof-mp/012 (dm-mpath on top of multiple I/O schedulers) [passed]
runtime 5.922s ... 8.804s
$ cat results/nodev/nvmeof-mp/012.full | grep -n "Changing scheduler"
31:Changing scheduler of dm-3 from mq-deadline kyber [bfq] none into cfq failed
47:Changing scheduler of dm-3 from mq-deadline kyber [bfq] none into cfq failed
Signed-off-by: Yi Zhang <yi.zhang at redhat.com>
---
tests/nvmeof-mp/012 | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/tests/nvmeof-mp/012 b/tests/nvmeof-mp/012
index ae6a92c..96adc70 100755
--- a/tests/nvmeof-mp/012
+++ b/tests/nvmeof-mp/012
@@ -8,7 +8,7 @@ DESCRIPTION="dm-mpath on top of multiple I/O schedulers"
QUICK=1
test_io_schedulers() {
- local dev m
+ local dev m dm scheds
# Load all I/O scheduler kernel modules
for m in "/lib/modules/$(uname -r)/kernel/block/"*.ko; do
@@ -17,15 +17,17 @@ test_io_schedulers() {
for mq in y n; do
use_blk_mq ${mq} || return $?
dev=$(get_bdev 0) || return $?
- for sched in noop deadline bfq cfq; do
- set_scheduler "$(basename "$(readlink -f "${dev}")")" $sched \
+ dm=$(basename "$(readlink -f "${dev}")") || return $?
+ scheds=$(sed 's/[][]//g' /sys/block/"$dm"/queue/scheduler) || return $?
+ for sched in $scheds; do
+ set_scheduler "$dm" "$sched" \
>>"$FULL" 2>&1 || continue
echo "I/O scheduler: $sched; use_blk_mq: $mq" >>"$FULL"
run_fio --verify=md5 --rw=randwrite --bs=4K --size=64K \
--ioengine=libaio --iodepth=64 \
--iodepth_batch=32 --group_reporting --sync=1 \
--direct=1 --filename="$dev" \
- --name=${sched} --thread --numjobs=1 \
+ --name="${sched}" --thread --numjobs=1 \
--output="${RESULTS_DIR}/nvmeof-mp/012-${sched}-${mq}.txt" \
>>"$FULL" ||
return $?
--
2.21.0
More information about the Linux-nvme
mailing list