public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH blktests v2] tests: use nproc to get number of CPUs for fio jobs
@ 2017-06-30  9:07 Johannes Thumshirn
  2017-07-14  9:26 ` Johannes Thumshirn
  2017-07-14 17:11 ` Omar Sandoval
  0 siblings, 2 replies; 3+ messages in thread
From: Johannes Thumshirn @ 2017-06-30  9:07 UTC (permalink / raw)
  To: Omar Sandoval
  Cc: Jens Axboe, Linux Block Layer Mailinglist, Johannes Thumshirn

Use nproc to get number of CPUs for fio jobs and introduce
_run_fio_rand_io helper for parallel IO which we don't really care about
the details and just want some IO.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
---
 common/fio      | 7 +++++++
 tests/block/005 | 4 +---
 tests/block/006 | 2 +-
 tests/block/008 | 4 +---
 tests/block/011 | 5 ++---
 5 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/common/fio b/common/fio
index 86ed4b2b7180..2b0759d19f5d 100644
--- a/common/fio
+++ b/common/fio
@@ -166,6 +166,13 @@ _run_fio() {
 	fio "${args[@]}" "$@"
 }
 
+# Wrapper around _run_fio used if you need some I/O but don't really care much
+# about the details
+_run_fio_rand_io() {
+	_run_fio --bs=4k --rw=randread --norandommap --numjobs=$(nproc) \
+		--name=reads --direct=1
+}
+
 _fio_perf_report() {
 	# If there is more than one group, we don't know what to report.
 	if [[ $(wc -l < "$TMPDIR/fio_perf") -gt 1 ]]; then
diff --git a/tests/block/005 b/tests/block/005
index 8f8b7065404e..e59a3e35221b 100755
--- a/tests/block/005
+++ b/tests/block/005
@@ -36,9 +36,7 @@ test_device() {
 	fi
 
 	# start fio job
-	_run_fio --bs=4k --rw=randread --norandommap \
-		--name=reads --filename="$TEST_DEV" --size="$size" \
-		--numjobs=8 --direct=1 &
+	_run_fio_rand_io --filename="$TEST_DEV" --size="$size" &
 
 	# 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..03abf57241bd 100755
--- a/tests/block/008
+++ b/tests/block/008
@@ -36,9 +36,7 @@ test_device() {
 	fi
 
 	# start fio job
-	_run_fio --bs=4k --rw=randread --norandommap \
-		--name=reads --filename="$TEST_DEV" --size="$size" \
-		--numjobs=8 --direct=1 &
+	_run_fio_rand_io --filename="$TEST_DEV" --size="$size" &
 
 	# 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..920c58bb8ee4 100755
--- a/tests/block/011
+++ b/tests/block/011
@@ -40,9 +40,8 @@ test_device() {
 	fi
 
 	# 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 &
+	_run_fio_rand_io --filename="$TEST_DEV" --size="$size" \
+			--ignore_error=EIO,ENXIO,ENODEV &
 
 	while kill -0 $! 2>/dev/null; do
 		echo 0 > "/sys/bus/pci/devices/${pdev}/enable"
-- 
2.12.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH blktests v2] tests: use nproc to get number of CPUs for fio jobs
  2017-06-30  9:07 [PATCH blktests v2] tests: use nproc to get number of CPUs for fio jobs Johannes Thumshirn
@ 2017-07-14  9:26 ` Johannes Thumshirn
  2017-07-14 17:11 ` Omar Sandoval
  1 sibling, 0 replies; 3+ messages in thread
From: Johannes Thumshirn @ 2017-07-14  9:26 UTC (permalink / raw)
  To: Omar Sandoval; +Cc: Jens Axboe, Linux Block Layer Mailinglist

Omar, ping?
-- 
Johannes Thumshirn                                          Storage
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N�rnberg
GF: Felix Imend�rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N�rnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH blktests v2] tests: use nproc to get number of CPUs for fio jobs
  2017-06-30  9:07 [PATCH blktests v2] tests: use nproc to get number of CPUs for fio jobs Johannes Thumshirn
  2017-07-14  9:26 ` Johannes Thumshirn
@ 2017-07-14 17:11 ` Omar Sandoval
  1 sibling, 0 replies; 3+ messages in thread
From: Omar Sandoval @ 2017-07-14 17:11 UTC (permalink / raw)
  To: Johannes Thumshirn; +Cc: Jens Axboe, Linux Block Layer Mailinglist

On Fri, Jun 30, 2017 at 11:07:35AM +0200, Johannes Thumshirn wrote:
> Use nproc to get number of CPUs for fio jobs and introduce
> _run_fio_rand_io helper for parallel IO which we don't really care about
> the details and just want some IO.

Thanks, Johannes, applied with a fix below.

> Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
> ---
>  common/fio      | 7 +++++++
>  tests/block/005 | 4 +---
>  tests/block/006 | 2 +-
>  tests/block/008 | 4 +---
>  tests/block/011 | 5 ++---
>  5 files changed, 12 insertions(+), 10 deletions(-)
> 
> diff --git a/common/fio b/common/fio
> index 86ed4b2b7180..2b0759d19f5d 100644
> --- a/common/fio
> +++ b/common/fio
> @@ -166,6 +166,13 @@ _run_fio() {
>  	fio "${args[@]}" "$@"
>  }
>  
> +# Wrapper around _run_fio used if you need some I/O but don't really care much
> +# about the details
> +_run_fio_rand_io() {
> +	_run_fio --bs=4k --rw=randread --norandommap --numjobs=$(nproc) \
> +		--name=reads --direct=1

I added "$@" at the end here, it looks like that's what you intended and
it doesn't work otherwise.

> +}
> +

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-07-14 17:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-30  9:07 [PATCH blktests v2] tests: use nproc to get number of CPUs for fio jobs Johannes Thumshirn
2017-07-14  9:26 ` Johannes Thumshirn
2017-07-14 17:11 ` Omar Sandoval

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox