diff mbox series

[blktests,v2] block/020: dynamically change iodepth if test aio-nr lager than aio-max-nr

Message ID 20190406142722.6561-1-xiliang@redhat.com (mailing list archive)
State New, archived
Headers show
Series [blktests,v2] block/020: dynamically change iodepth if test aio-nr lager than aio-max-nr | expand

Commit Message

Xiao Liang April 6, 2019, 2:27 p.m. UTC
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 | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Comments

Omar Sandoval April 17, 2019, 9:41 p.m. UTC | #1
On Sat, Apr 06, 2019 at 10:27:22PM +0800, Xiao Liang wrote:
> 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.

Thank you, applied.
diff mbox series

Patch

diff --git a/tests/block/020 b/tests/block/020
index 39dde66..6583a3f 100755
--- a/tests/block/020
+++ b/tests/block/020
@@ -29,10 +29,16 @@  test() {
 	# shellcheck disable=SC2207
 	scheds=($(sed 's/[][]//g' /sys/block/nullb0/queue/scheduler))
 
+	aio_max_nr=$(cat /proc/sys/fs/aio-max-nr)
+	max_iodepth=$((aio_max_nr/$(nproc)))
+	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