diff mbox

[blktests] tests: use nproc to get number of CPUs for fio jobs

Message ID 20170629114050.11733-1-jthumshirn@suse.de (mailing list archive)
State New, archived
Headers show

Commit Message

Johannes Thumshirn June 29, 2017, 11:40 a.m. UTC
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
---
 tests/block/004 | 2 +-
 tests/block/005 | 2 +-
 tests/block/006 | 2 +-
 tests/block/008 | 2 +-
 tests/block/011 | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

Comments

Jens Axboe June 29, 2017, 2:08 p.m. UTC | #1
On 06/29/2017 05:40 AM, Johannes Thumshirn wrote:
> Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
> ---
>  tests/block/004 | 2 +-
>  tests/block/005 | 2 +-
>  tests/block/006 | 2 +-
>  tests/block/008 | 2 +-
>  tests/block/011 | 2 +-
>  5 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/tests/block/004 b/tests/block/004
> index 754d30260d63..2dc0f25b27cc 100755
> --- a/tests/block/004
> +++ b/tests/block/004
> @@ -29,7 +29,7 @@ test_device() {
>  
>  	FIO_PERF_FIELDS=("write iops")
>  	_fio_perf --bs=4k --rw=randwrite --norandommap --fsync=1 \
> -		--number_ios=256 --numjobs=64 --name=flushes \
> +		--number_ios=256 --numjobs=$(nproc) --name=flushes \
>  		--filename="$TEST_DEV"

NAK on this bit. Let's use the nproc for cases that just want a random
suitable workload for their machine. For flush, the idea here is to
use a ton of flushes. This has shown bugs in the past, like this
for instance:

commit 7520872c0cf4d3df6d74242c6edfb9e70a47df4d
Author: Jens Axboe <axboe@fb.com>
Date:   Fri Feb 17 11:40:44 2017 -0700

    block: don't defer flushes on blk-mq + scheduling

For the other tests in your patch, the change looks fine. But I would
greatly prefer if we just turned that into a

__run_fio_mix

or similar command, since the jobs should basically be identical.
Johannes Thumshirn June 29, 2017, 2:13 p.m. UTC | #2
On Thu, Jun 29, 2017 at 08:08:32AM -0600, Jens Axboe wrote:
> For the other tests in your patch, the change looks fine. But I would
> greatly prefer if we just turned that into a
> 
> __run_fio_mix

Sounds reasonable. I'll prepare a v2
diff mbox

Patch

diff --git a/tests/block/004 b/tests/block/004
index 754d30260d63..2dc0f25b27cc 100755
--- a/tests/block/004
+++ b/tests/block/004
@@ -29,7 +29,7 @@  test_device() {
 
 	FIO_PERF_FIELDS=("write iops")
 	_fio_perf --bs=4k --rw=randwrite --norandommap --fsync=1 \
-		--number_ios=256 --numjobs=64 --name=flushes \
+		--number_ios=256 --numjobs=$(nproc) --name=flushes \
 		--filename="$TEST_DEV"
 
 	echo "Test complete"
diff --git a/tests/block/005 b/tests/block/005
index 8f8b7065404e..4d4d536324ab 100755
--- a/tests/block/005
+++ b/tests/block/005
@@ -38,7 +38,7 @@  test_device() {
 	# start fio job
 	_run_fio --bs=4k --rw=randread --norandommap \
 		--name=reads --filename="$TEST_DEV" --size="$size" \
-		--numjobs=8 --direct=1 &
+		--numjobs=$(nproc) --direct=1 &
 
 	# while job is running, switch between schedulers
 	while kill -0 $! 2>/dev/null; do
diff --git a/tests/block/006 b/tests/block/006
index 18e31cbf3809..2b8450104e46 100755
--- a/tests/block/006
+++ b/tests/block/006
@@ -43,7 +43,7 @@  test() {
 		--filename=/dev/nullb0 --size=5g --direct=1
 
 	# run async test
-	_fio_perf --bs=4k --ioengine=libaio --iodepth=8 --numjobs=4 \
+	_fio_perf --bs=4k --ioengine=libaio --iodepth=8 --numjobs=$(nproc) \
 		--rw=randread --norandommap --name=async \
 		--filename=/dev/nullb0 --size=5g --direct=1
 
diff --git a/tests/block/008 b/tests/block/008
index 033fa0d5e7a5..db8fecc54676 100755
--- a/tests/block/008
+++ b/tests/block/008
@@ -38,7 +38,7 @@  test_device() {
 	# start fio job
 	_run_fio --bs=4k --rw=randread --norandommap \
 		--name=reads --filename="$TEST_DEV" --size="$size" \
-		--numjobs=8 --direct=1 &
+		--numjobs=$(nproc) --direct=1 &
 
 	# while job is running, hotplug CPUs randomly
 	while kill -0 $! 2>/dev/null; do
diff --git a/tests/block/011 b/tests/block/011
index 65ed3dfa7092..53ed7e037d21 100755
--- a/tests/block/011
+++ b/tests/block/011
@@ -42,7 +42,7 @@  test_device() {
 	# start fio job
 	_run_fio --bs=4k --rw=randread --norandommap \
 		--name=reads --filename="$TEST_DEV" --size="$size" \
-		--numjobs=8 --direct=1 --ignore_error=EIO,ENXIO,ENODEV &
+		--numjobs=$(nproc) --direct=1 --ignore_error=EIO,ENXIO,ENODEV &
 
 	while kill -0 $! 2>/dev/null; do
 		echo 0 > "/sys/bus/pci/devices/${pdev}/enable"