-
Notifications
You must be signed in to change notification settings - Fork 92
Expand file tree
/
Copy path012
More file actions
executable file
·46 lines (41 loc) · 1.25 KB
/
012
File metadata and controls
executable file
·46 lines (41 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0+
# Copyright (c) 2018 Western Digital Corporation or its affiliates
. tests/srp/rc
DESCRIPTION="dm-mpath on top of multiple I/O schedulers"
QUICK=1
test_io_schedulers() {
local dev m dm scheds
# Load all I/O scheduler kernel modules
for m in "/lib/modules/$(uname -r)/kernel/block/"*.ko; do
modprobe "$(basename "$m")" >&/dev/null
done
for mq in y n; do
if [ $mq = n ] && ! _have_legacy_dm; then
unset SKIP_REASONS
continue
fi
use_blk_mq ${mq} ${mq} || return $?
dev=$(get_bdev 0) || return $?
dm=$(basename "$(readlink --canonicalize "${dev}")") || return $?
scheds="$(_io_schedulers "$dm")" || 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 \
--output="${RESULTS_DIR}/srp/012-${sched}-${mq}.txt" \
>>"$FULL" ||
return $?
done
done
return 0
}
test() {
trap 'trap "" EXIT; teardown' EXIT
setup && test_io_schedulers && echo Passed
}