Re: [PATCH v4 1/5] fsstress: add IO_URING read and write operations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <zlang@xxxxxxxxxx>
> ---
>  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 <bfoster@xxxxxxxxxx>

> +		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
> 




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux