public inbox for [email protected]
 help / color / mirror / Atom feed
From: Brian Foster <[email protected]>
To: Zorro Lang <[email protected]>
Cc: [email protected], [email protected]
Subject: Re: [PATCH v4 1/5] fsstress: add IO_URING read and write operations
Date: Tue, 8 Sep 2020 14:34:50 -0400	[thread overview]
Message-ID: <20200908183450.GA737175@bfoster> (raw)
In-Reply-To: <[email protected]>

On Mon, Sep 07, 2020 at 01:55:09AM +0800, Zorro Lang wrote:
> IO_URING is a new feature of curent linux kernel, add basic IO_URING
> read/write into fsstess to cover this kind of IO testing.
> 
> Signed-off-by: Zorro Lang <[email protected]>
> ---
>  README                 |   4 +-
>  configure.ac           |   1 +
>  include/builddefs.in   |   1 +
>  ltp/Makefile           |   5 ++
>  ltp/fsstress.c         | 139 ++++++++++++++++++++++++++++++++++++++++-
>  m4/Makefile            |   1 +
>  m4/package_liburing.m4 |   4 ++
>  7 files changed, 152 insertions(+), 3 deletions(-)
>  create mode 100644 m4/package_liburing.m4
> 
...
> diff --git a/ltp/fsstress.c b/ltp/fsstress.c
> index 709fdeec..2c584ef0 100644
> --- a/ltp/fsstress.c
> +++ b/ltp/fsstress.c
...
> @@ -2170,6 +2189,108 @@ do_aio_rw(int opno, long r, int flags)
>  }
>  #endif
>  
> +#ifdef URING
> +void
> +do_uring_rw(int opno, long r, int flags)
> +{
...
> +
> + uring_out:
> +	if (buf)
> +		free(buf);
> +	if (fd > 0)

Nit: I'd replace this with (fd != -1), but otherwise:

Reviewed-by: Brian Foster <[email protected]>

> +		close(fd);
> +	free_pathname(&f);
> +}
> +#endif
> +
>  void
>  aread_f(int opno, long r)
>  {
> @@ -5044,6 +5165,22 @@ unresvsp_f(int opno, long r)
>  	close(fd);
>  }
>  
> +void
> +uring_read_f(int opno, long r)
> +{
> +#ifdef URING
> +	do_uring_rw(opno, r, O_RDONLY);
> +#endif
> +}
> +
> +void
> +uring_write_f(int opno, long r)
> +{
> +#ifdef URING
> +	do_uring_rw(opno, r, O_WRONLY);
> +#endif
> +}
> +
>  void
>  write_f(int opno, long r)
>  {
> diff --git a/m4/Makefile b/m4/Makefile
> index 7fbff822..0352534d 100644
> --- a/m4/Makefile
> +++ b/m4/Makefile
> @@ -14,6 +14,7 @@ LSRCFILES = \
>  	package_dmapidev.m4 \
>  	package_globals.m4 \
>  	package_libcdev.m4 \
> +	package_liburing.m4 \
>  	package_ncurses.m4 \
>  	package_pthread.m4 \
>  	package_ssldev.m4 \
> diff --git a/m4/package_liburing.m4 b/m4/package_liburing.m4
> new file mode 100644
> index 00000000..c92cc02a
> --- /dev/null
> +++ b/m4/package_liburing.m4
> @@ -0,0 +1,4 @@
> +AC_DEFUN([AC_PACKAGE_WANT_URING],
> +  [ AC_CHECK_HEADERS(liburing.h, [ have_uring=true ], [ have_uring=false ])
> +    AC_SUBST(have_uring)
> +  ])
> -- 
> 2.20.1
> 


  reply	other threads:[~2020-09-08 18:35 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-06 17:55 [PATCH v4 0/5] fsstress,fsx: add io_uring test and do some fix Zorro Lang
2020-09-06 17:55 ` [PATCH v4 1/5] fsstress: add IO_URING read and write operations Zorro Lang
2020-09-08 18:34   ` Brian Foster [this message]
2020-09-06 17:55 ` [PATCH v4 2/5] fsstress: reduce the number of events when io_setup Zorro Lang
2020-09-08 18:34   ` Brian Foster
2020-09-06 17:55 ` [PATCH v4 3/5] fsstress: fix memory leak in do_aio_rw Zorro Lang
2020-09-08 18:35   ` Brian Foster
2020-09-06 17:55 ` [PATCH v4 4/5] fsx: introduce fsx_rw to combine aio_rw with general read and write Zorro Lang
2020-09-08 18:35   ` Brian Foster
2020-09-06 17:55 ` [PATCH v4 5/5] fsx: add IO_URING test Zorro Lang
2020-09-08 18:36   ` Brian Foster
2020-09-09  3:58     ` Zorro Lang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200908183450.GA737175@bfoster \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox