diff mbox series

[REPOST,blktests,v2,4/9] nvme: Use runtime fio background jobs

Message ID 20230421060505.10132-5-dwagner@suse.de (mailing list archive)
State New, archived
Headers show
Series nvme testsuite runtime optimization | expand

Commit Message

Daniel Wagner April 21, 2023, 6:05 a.m. UTC
The fio jobs are supposed to run long in background during the test.
Instead relying on a job size use explicit runtime for this.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
---
 tests/nvme/032 | 2 +-
 tests/nvme/040 | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

Comments

Hannes Reinecke April 21, 2023, 6:29 a.m. UTC | #1
On 4/21/23 08:05, Daniel Wagner wrote:
> The fio jobs are supposed to run long in background during the test.
> Instead relying on a job size use explicit runtime for this.
> 
> Signed-off-by: Daniel Wagner <dwagner@suse.de>
> ---
>   tests/nvme/032 | 2 +-
>   tests/nvme/040 | 3 ++-
>   2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/nvme/032 b/tests/nvme/032
> index 017d4a339971..81e074cc11bc 100755
> --- a/tests/nvme/032
> +++ b/tests/nvme/032
> @@ -39,7 +39,7 @@ test_device() {
>   
>   	# start fio job
>   	_run_fio_rand_io --filename="$TEST_DEV" --size=1g \
> -		--group_reporting  &> /dev/null &
> +		--group_reporting --time_based --runtime=1m &> /dev/null &
>   
>   	sleep 5
>   
> diff --git a/tests/nvme/040 b/tests/nvme/040
> index 04bd726cd309..8d29f905adb5 100755
> --- a/tests/nvme/040
> +++ b/tests/nvme/040
> @@ -38,7 +38,8 @@ test() {
>   	# start fio job
>   	echo "starting background fio"
>   	_run_fio_rand_io --filename="/dev/${nvmedev}n1" --size=1g \
> -		--group_reporting --ramp_time=5  &> /dev/null &
> +		--group_reporting --ramp_time=5 \
> +		--time_based --runtime=1m &> /dev/null &
>   	sleep 5
>   
>   	# do reset/remove operation

Wouldn't it be better to let _run_fio_rand_io pick the correct size?

Cheers,

Hannes
Daniel Wagner April 21, 2023, 6:57 a.m. UTC | #2
On Fri, Apr 21, 2023 at 08:29:22AM +0200, Hannes Reinecke wrote:
 > --- a/tests/nvme/040
> > +++ b/tests/nvme/040
> > @@ -38,7 +38,8 @@ test() {
> >   	# start fio job
> >   	echo "starting background fio"
> >   	_run_fio_rand_io --filename="/dev/${nvmedev}n1" --size=1g \
> > -		--group_reporting --ramp_time=5  &> /dev/null &
> > +		--group_reporting --ramp_time=5 \
> > +		--time_based --runtime=1m &> /dev/null &
> >   	sleep 5
> >   	# do reset/remove operation
> 
> Wouldn't it be better to let _run_fio_rand_io pick the correct size?

Yes, makes sense.
Shinichiro Kawasaki April 28, 2023, 4:29 a.m. UTC | #3
On Apr 21, 2023 / 08:57, Daniel Wagner wrote:
> On Fri, Apr 21, 2023 at 08:29:22AM +0200, Hannes Reinecke wrote:
>  > --- a/tests/nvme/040
> > > +++ b/tests/nvme/040
> > > @@ -38,7 +38,8 @@ test() {
> > >   	# start fio job
> > >   	echo "starting background fio"
> > >   	_run_fio_rand_io --filename="/dev/${nvmedev}n1" --size=1g \
> > > -		--group_reporting --ramp_time=5  &> /dev/null &
> > > +		--group_reporting --ramp_time=5 \
> > > +		--time_based --runtime=1m &> /dev/null &
> > >   	sleep 5
> > >   	# do reset/remove operation
> > 
> > Wouldn't it be better to let _run_fio_rand_io pick the correct size?
> 
> Yes, makes sense.

If you do I/O size change for the test cases nvme/032 and nvme/040, could you
confirm the runtime reduction of the test cases? IIUC, the fio process stops
due to process kill or an I/O error, then I/O size reduction will not change
runtime of the test cases, I guess.

IMO, --time_based --runtime=1m is good to ensure that fio runs long enough,
even when nvme device size is configured with small size.
Daniel Wagner May 2, 2023, 2:22 p.m. UTC | #4
On Fri, Apr 28, 2023 at 04:29:57AM +0000, Shinichiro Kawasaki wrote:
> On Apr 21, 2023 / 08:57, Daniel Wagner wrote:
> > On Fri, Apr 21, 2023 at 08:29:22AM +0200, Hannes Reinecke wrote:
> >  > --- a/tests/nvme/040
> > > > +++ b/tests/nvme/040
> > > > @@ -38,7 +38,8 @@ test() {
> > > >   	# start fio job
> > > >   	echo "starting background fio"
> > > >   	_run_fio_rand_io --filename="/dev/${nvmedev}n1" --size=1g \
> > > > -		--group_reporting --ramp_time=5  &> /dev/null &
> > > > +		--group_reporting --ramp_time=5 \
> > > > +		--time_based --runtime=1m &> /dev/null &
> > > >   	sleep 5
> > > >   	# do reset/remove operation
> > > 
> > > Wouldn't it be better to let _run_fio_rand_io pick the correct size?
> > 
> > Yes, makes sense.
> 
> If you do I/O size change for the test cases nvme/032 and nvme/040, could you
> confirm the runtime reduction of the test cases? IIUC, the fio process stops
> due to process kill or an I/O error, then I/O size reduction will not change
> runtime of the test cases, I guess.

The fio process doesn't survive the reset and the deletion of the controller.

> IMO, --time_based --runtime=1m is good to ensure that fio runs long enough,
> even when nvme device size is configured with small size.

I've updated the time to 'infinity' and added a 'kill $pid' after reset and
delete. Though the process should be gone till then but making the test a bit
more robust should hurt.
diff mbox series

Patch

diff --git a/tests/nvme/032 b/tests/nvme/032
index 017d4a339971..81e074cc11bc 100755
--- a/tests/nvme/032
+++ b/tests/nvme/032
@@ -39,7 +39,7 @@  test_device() {
 
 	# start fio job
 	_run_fio_rand_io --filename="$TEST_DEV" --size=1g \
-		--group_reporting  &> /dev/null &
+		--group_reporting --time_based --runtime=1m &> /dev/null &
 
 	sleep 5
 
diff --git a/tests/nvme/040 b/tests/nvme/040
index 04bd726cd309..8d29f905adb5 100755
--- a/tests/nvme/040
+++ b/tests/nvme/040
@@ -38,7 +38,8 @@  test() {
 	# start fio job
 	echo "starting background fio"
 	_run_fio_rand_io --filename="/dev/${nvmedev}n1" --size=1g \
-		--group_reporting --ramp_time=5  &> /dev/null &
+		--group_reporting --ramp_time=5 \
+		--time_based --runtime=1m &> /dev/null &
 	sleep 5
 
 	# do reset/remove operation