]> www.infradead.org Git - users/hch/blktests.git/commitdiff
block/020: dynamically change iodepth if test aio-nr lager than aio-max-nr
authorXiao Liang <xiliang@redhat.com>
Sat, 6 Apr 2019 14:27:22 +0000 (22:27 +0800)
committerOmar Sandoval <osandov@fb.com>
Wed, 17 Apr 2019 21:41:34 +0000 (14:41 -0700)
When system has large count of cpus(eg. 96), the test failed as aio-nr over
aio-max-nr limitation.

This patch continues to use 1024 as default iodepth, but change it if
iodepth*$(nproc) > aio-max-nr.

Signed-off-by: Xiao Liang <xiliang@redhat.com>
tests/block/020

index 39dde6636023dec58399e421d3501a76775214ea..b4887a26ff0a7b84820f1c64444c30577a11f0e0 100755 (executable)
@@ -29,10 +29,15 @@ test() {
        # shellcheck disable=SC2207
        scheds=($(sed 's/[][]//g' /sys/block/nullb0/queue/scheduler))
 
+       local max_iodepth=$(($(cat /proc/sys/fs/aio-max-nr) / $(nproc)))
+       local iodepth=1024
+       if (( iodepth > max_iodepth )); then
+               iodepth=$max_iodepth
+       fi
        for sched in "${scheds[@]}"; do
                echo "Testing $sched" >> "$FULL"
                echo "$sched" > /sys/block/nullb0/queue/scheduler
-               _fio_perf --bs=4k --ioengine=libaio --iodepth=1024 \
+               _fio_perf --bs=4k --ioengine=libaio --iodepth=$iodepth \
                        --numjobs="$(nproc)" --rw=randread --name=async \
                        --filename=/dev/nullb0 --size=1g --direct=1 \
                        --runtime=10