diff mbox series

[2/4] fsstress: reduce the number of events when io_setup

Message ID 20200728182320.8762-3-zlang@redhat.com (mailing list archive)
State New, archived
Headers show
Series fsstress,fsx: add io_uring test and do some fix | expand

Commit Message

Zorro Lang July 28, 2020, 6:23 p.m. UTC
The original number(128) of aio events for io_setup is a little big.
When try to run lots of fsstress processes(e.g. -p 1000) always hit
io_setup EAGAIN error, due to the nr_events exceeds the limit of
available events. So reduce it from 128 to 64, to make more fsstress
processes can do AIO test.

Signed-off-by: Zorro Lang <zlang@redhat.com>
---
 ltp/fsstress.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Jeff Moyer July 29, 2020, 7:43 p.m. UTC | #1
Zorro Lang <zlang@redhat.com> writes:

> The original number(128) of aio events for io_setup is a little big.
> When try to run lots of fsstress processes(e.g. -p 1000) always hit
> io_setup EAGAIN error, due to the nr_events exceeds the limit of
> available events. So reduce it from 128 to 64, to make more fsstress
> processes can do AIO test.

It looks to me as though there's only ever one request in flight.  I'd
just set it to 1.

Also, you've included another change not mentioned in your changelog.
Please make sure the changelog matches what's done in the patch.

-Jeff

>
> Signed-off-by: Zorro Lang <zlang@redhat.com>
> ---
>  ltp/fsstress.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/ltp/fsstress.c b/ltp/fsstress.c
> index 388ace50..a11206d4 100644
> --- a/ltp/fsstress.c
> +++ b/ltp/fsstress.c
> @@ -28,6 +28,7 @@
>  #endif
>  #ifdef AIO
>  #include <libaio.h>
> +#define AIO_ENTRIES	64
>  io_context_t	io_ctx;
>  #endif
>  #ifdef URING
> @@ -699,8 +700,8 @@ int main(int argc, char **argv)
>  			}
>  			procid = i;
>  #ifdef AIO
> -			if (io_setup(128, &io_ctx) != 0) {
> -				fprintf(stderr, "io_setup failed");
> +			if (io_setup(AIO_ENTRIES, &io_ctx) != 0) {
> +				fprintf(stderr, "io_setup failed\n");
>  				exit(1);
>  			}
>  #endif
> @@ -714,7 +715,7 @@ int main(int argc, char **argv)
>  				doproc();
>  #ifdef AIO
>  			if(io_destroy(io_ctx) != 0) {
> -				fprintf(stderr, "io_destroy failed");
> +				fprintf(stderr, "io_destroy failed\n");
>  				return 1;
>  			}
>  #endif
Zorro Lang Aug. 2, 2020, 5:32 p.m. UTC | #2
On Wed, Jul 29, 2020 at 03:43:39PM -0400, Jeff Moyer wrote:
> Zorro Lang <zlang@redhat.com> writes:
> 
> > The original number(128) of aio events for io_setup is a little big.
> > When try to run lots of fsstress processes(e.g. -p 1000) always hit
> > io_setup EAGAIN error, due to the nr_events exceeds the limit of
> > available events. So reduce it from 128 to 64, to make more fsstress
> > processes can do AIO test.
> 
> It looks to me as though there's only ever one request in flight.  I'd
> just set it to 1.
> 
> Also, you've included another change not mentioned in your changelog.
> Please make sure the changelog matches what's done in the patch.

Thanks Jeff, I'll rewrite this patch:) Do you have any review points about
those two IO_URING related patches (1/4 and 4/4), or it looks good to you?

Thanks,
Zorro

> 
> -Jeff
> 
> >
> > Signed-off-by: Zorro Lang <zlang@redhat.com>
> > ---
> >  ltp/fsstress.c | 7 ++++---
> >  1 file changed, 4 insertions(+), 3 deletions(-)
> >
> > diff --git a/ltp/fsstress.c b/ltp/fsstress.c
> > index 388ace50..a11206d4 100644
> > --- a/ltp/fsstress.c
> > +++ b/ltp/fsstress.c
> > @@ -28,6 +28,7 @@
> >  #endif
> >  #ifdef AIO
> >  #include <libaio.h>
> > +#define AIO_ENTRIES	64
> >  io_context_t	io_ctx;
> >  #endif
> >  #ifdef URING
> > @@ -699,8 +700,8 @@ int main(int argc, char **argv)
> >  			}
> >  			procid = i;
> >  #ifdef AIO
> > -			if (io_setup(128, &io_ctx) != 0) {
> > -				fprintf(stderr, "io_setup failed");
> > +			if (io_setup(AIO_ENTRIES, &io_ctx) != 0) {
> > +				fprintf(stderr, "io_setup failed\n");
> >  				exit(1);
> >  			}
> >  #endif
> > @@ -714,7 +715,7 @@ int main(int argc, char **argv)
> >  				doproc();
> >  #ifdef AIO
> >  			if(io_destroy(io_ctx) != 0) {
> > -				fprintf(stderr, "io_destroy failed");
> > +				fprintf(stderr, "io_destroy failed\n");
> >  				return 1;
> >  			}
> >  #endif
>
diff mbox series

Patch

diff --git a/ltp/fsstress.c b/ltp/fsstress.c
index 388ace50..a11206d4 100644
--- a/ltp/fsstress.c
+++ b/ltp/fsstress.c
@@ -28,6 +28,7 @@ 
 #endif
 #ifdef AIO
 #include <libaio.h>
+#define AIO_ENTRIES	64
 io_context_t	io_ctx;
 #endif
 #ifdef URING
@@ -699,8 +700,8 @@  int main(int argc, char **argv)
 			}
 			procid = i;
 #ifdef AIO
-			if (io_setup(128, &io_ctx) != 0) {
-				fprintf(stderr, "io_setup failed");
+			if (io_setup(AIO_ENTRIES, &io_ctx) != 0) {
+				fprintf(stderr, "io_setup failed\n");
 				exit(1);
 			}
 #endif
@@ -714,7 +715,7 @@  int main(int argc, char **argv)
 				doproc();
 #ifdef AIO
 			if(io_destroy(io_ctx) != 0) {
-				fprintf(stderr, "io_destroy failed");
+				fprintf(stderr, "io_destroy failed\n");
 				return 1;
 			}
 #endif