fstests.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] xfstests: add IO_URING test cases
@ 2020-09-16 17:14 Zorro Lang
  2020-09-16 17:14 ` [PATCH 1/3] src/feature: add IO_URING feature checking Zorro Lang
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Zorro Lang @ 2020-09-16 17:14 UTC (permalink / raw)
  To: fstests; +Cc: io-uring

This patchset bases on https://patchwork.kernel.org/cover/11769847/, which
makes xfstests fsstress and fsx supports IO_URING.

The io_uring IOs in fsstress will be run automatically when fsstress get
running. But fsx need a special option '-U' to run IO_URING read/write, so
add two new cases to xfstests to do fsx buffered and direct IO IO_URING
test.

[1/3] new helper to require io_uring feature
[2/3] fsx buffered IO io_uring test
[3/3] fsx direct IO io_uring test

And the [2/3] just found an io_uring regression bug (need LVM TEST_DEV):
https://bugzilla.kernel.org/show_bug.cgi?id=209243

Feel free to tell me, if you have more suggestions to test io_uring on
filesystem.

Thanks,
Zorro


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

* [PATCH 1/3] src/feature: add IO_URING feature checking
  2020-09-16 17:14 [PATCH 0/3] xfstests: add IO_URING test cases Zorro Lang
@ 2020-09-16 17:14 ` Zorro Lang
  2020-10-02 18:19   ` Brian Foster
  2020-09-16 17:14 ` [PATCH 2/3] generic: fsx IO_URING soak tests Zorro Lang
  2020-09-16 17:14 ` [PATCH 3/3] generic: IO_URING direct IO fsx test Zorro Lang
  2 siblings, 1 reply; 15+ messages in thread
From: Zorro Lang @ 2020-09-16 17:14 UTC (permalink / raw)
  To: fstests; +Cc: io-uring

IO_URING is a new feature for GNU/Linux system, if someone case of
xfstests tests this feature, better to check if current system
supports it, or need _notrun.

Signed-off-by: Zorro Lang <zlang@redhat.com>
---
 src/Makefile  |  4 ++++
 src/feature.c | 41 ++++++++++++++++++++++++++++++++++++++---
 2 files changed, 42 insertions(+), 3 deletions(-)

diff --git a/src/Makefile b/src/Makefile
index 643c1916..f1422c5c 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -65,6 +65,10 @@ SUBDIRS += aio-dio-regress
 LLDLIBS += -laio
 endif
 
+ifeq ($(HAVE_URING), true)
+LLDLIBS += -luring
+endif
+
 CFILES = $(TARGETS:=.c)
 LDIRT = $(TARGETS) fssum
 
diff --git a/src/feature.c b/src/feature.c
index a7eb7595..df550cf6 100644
--- a/src/feature.c
+++ b/src/feature.c
@@ -19,6 +19,7 @@
  *
  * Test for machine features
  *   -A  test whether AIO syscalls are available
+ *   -R  test whether IO_URING syscalls are available
  *   -o  report a number of online cpus
  *   -s  report pagesize
  *   -w  report bits per long
@@ -39,6 +40,10 @@
 #include <libaio.h>
 #endif
 
+#ifdef HAVE_LIBURING_H
+#include <liburing.h>
+#endif
+
 #ifndef USRQUOTA
 #define USRQUOTA  0
 #endif
@@ -59,7 +64,7 @@ usage(void)
 	fprintf(stderr, "Usage: feature [-v] -<q|u|g|p|U|G|P> <filesystem>\n");
 	fprintf(stderr, "       feature [-v] -c <file>\n");
 	fprintf(stderr, "       feature [-v] -t <file>\n");
-	fprintf(stderr, "       feature -A | -o | -s | -w\n");
+	fprintf(stderr, "       feature -A | -R | -o | -s | -w\n");
 	exit(1);
 }
 
@@ -215,6 +220,29 @@ check_aio_support(void)
 #endif
 }
 
+static int
+check_uring_support(void)
+{
+#ifdef HAVE_LIBURING_H
+	struct io_uring ring;
+	int err;
+
+	err = io_uring_queue_init(1, &ring, 0);
+	if (err == 0)
+		return 0;
+
+	if (err == -ENOSYS) /* CONFIG_IO_URING=n */
+		return 1;
+
+	fprintf(stderr, "unexpected error from io_uring_queue_init(): %s\n",
+		strerror(-err));
+	return 2;
+#else
+	/* liburing is unavailable, assume IO_URING is unsupported */
+	return 1;
+#endif
+}
+
 
 int
 main(int argc, char **argv)
@@ -228,6 +256,7 @@ main(int argc, char **argv)
 	int	pflag = 0;
 	int	Pflag = 0;
 	int	qflag = 0;
+	int	Rflag = 0;
 	int	sflag = 0;
 	int	uflag = 0;
 	int	Uflag = 0;
@@ -235,7 +264,7 @@ main(int argc, char **argv)
 	int	oflag = 0;
 	char	*fs = NULL;
 
-	while ((c = getopt(argc, argv, "ActgGopPqsuUvw")) != EOF) {
+	while ((c = getopt(argc, argv, "ActgGopPqRsuUvw")) != EOF) {
 		switch (c) {
 		case 'A':
 			Aflag++;
@@ -264,6 +293,9 @@ main(int argc, char **argv)
 		case 'q':
 			qflag++;
 			break;
+		case 'R':
+			Rflag++;
+			break;
 		case 's':
 			sflag++;
 			break;
@@ -289,7 +321,7 @@ main(int argc, char **argv)
 		if (optind != argc-1)	/* need a device */
 			usage();
 		fs = argv[argc-1];
-	} else if (Aflag || wflag || sflag || oflag) {
+	} else if (Aflag || Rflag || wflag || sflag || oflag) {
 		if (optind != argc)
 			usage();
 	} else 
@@ -317,6 +349,9 @@ main(int argc, char **argv)
 	if (Aflag)
 		return(check_aio_support());
 
+	if (Rflag)
+		return(check_uring_support());
+
 	if (sflag) {
 		printf("%d\n", getpagesize());
 		exit(0);
-- 
2.20.1


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

* [PATCH 2/3] generic: fsx IO_URING soak tests
  2020-09-16 17:14 [PATCH 0/3] xfstests: add IO_URING test cases Zorro Lang
  2020-09-16 17:14 ` [PATCH 1/3] src/feature: add IO_URING feature checking Zorro Lang
@ 2020-09-16 17:14 ` Zorro Lang
  2020-10-02 18:20   ` Brian Foster
  2020-09-16 17:14 ` [PATCH 3/3] generic: IO_URING direct IO fsx test Zorro Lang
  2 siblings, 1 reply; 15+ messages in thread
From: Zorro Lang @ 2020-09-16 17:14 UTC (permalink / raw)
  To: fstests; +Cc: io-uring

After fsx supports IO_URING read/write, add a test to do IO_URING
soak test of fsx.

Signed-off-by: Zorro Lang <zlang@redhat.com>
---
 common/rc             | 16 ++++++++++++
 tests/generic/609     | 58 +++++++++++++++++++++++++++++++++++++++++++
 tests/generic/609.out |  2 ++
 tests/generic/group   |  1 +
 4 files changed, 77 insertions(+)
 create mode 100755 tests/generic/609
 create mode 100644 tests/generic/609.out

diff --git a/common/rc b/common/rc
index aa5a7409..b6b39eba 100644
--- a/common/rc
+++ b/common/rc
@@ -1984,6 +1984,22 @@ _require_aiodio()
     _require_odirect
 }
 
+# this test requires that the kernel supports IO_URING
+_require_io_uring()
+{
+	$here/src/feature -R
+	case $? in
+	0)
+		;;
+	1)
+		_notrun "kernel does not support IO_URING"
+		;;
+	*)
+		_fail "unexpected error testing for IO_URING support"
+		;;
+	esac
+}
+
 # this test requires that a test program exists under src/
 # $1 - command (require)
 #
diff --git a/tests/generic/609 b/tests/generic/609
new file mode 100755
index 00000000..1d9b6fed
--- /dev/null
+++ b/tests/generic/609
@@ -0,0 +1,58 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2020 Red Hat Inc.  All Rights Reserved.
+#
+# FS QA Test 609
+#
+# IO_URING soak buffered fsx test
+#
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1	# failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+	cd /
+	rm -f $tmp.*
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+
+# remove previous $seqres.full before test
+rm -f $seqres.full
+
+# real QA test starts here
+
+# Modify as appropriate.
+_supported_fs generic
+_supported_os Linux
+_require_test
+_require_io_uring
+
+# Run fsx for a million ops or more
+nr_ops=$((100000 * TIME_FACTOR))
+op_sz=$((128000 * LOAD_FACTOR))
+file_sz=$((600000 * LOAD_FACTOR))
+fsx_file=$TEST_DIR/fsx.$seq
+
+fsx_args=(-S 0)
+fsx_args+=(-U)
+fsx_args+=(-q)
+fsx_args+=(-N $nr_ops)
+fsx_args+=(-p $((nr_ops / 100)))
+fsx_args+=(-o $op_sz)
+fsx_args+=(-l $file_sz)
+
+run_fsx "${fsx_args[@]}" | sed -e '/^fsx.*/d'
+
+# success, all done
+echo "Silence is golden"
+status=0
+exit
diff --git a/tests/generic/609.out b/tests/generic/609.out
new file mode 100644
index 00000000..0d75b384
--- /dev/null
+++ b/tests/generic/609.out
@@ -0,0 +1,2 @@
+QA output created by 609
+Silence is golden
diff --git a/tests/generic/group b/tests/generic/group
index aa969bcb..cf50f4a1 100644
--- a/tests/generic/group
+++ b/tests/generic/group
@@ -611,3 +611,4 @@
 606 auto attr quick dax
 607 auto attr quick dax
 608 auto attr quick dax
+609 auto rw io_uring
-- 
2.20.1


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

* [PATCH 3/3] generic: IO_URING direct IO fsx test
  2020-09-16 17:14 [PATCH 0/3] xfstests: add IO_URING test cases Zorro Lang
  2020-09-16 17:14 ` [PATCH 1/3] src/feature: add IO_URING feature checking Zorro Lang
  2020-09-16 17:14 ` [PATCH 2/3] generic: fsx IO_URING soak tests Zorro Lang
@ 2020-09-16 17:14 ` Zorro Lang
  2020-10-02 18:20   ` Brian Foster
  2020-10-05 16:45   ` Darrick J. Wong
  2 siblings, 2 replies; 15+ messages in thread
From: Zorro Lang @ 2020-09-16 17:14 UTC (permalink / raw)
  To: fstests; +Cc: io-uring

After fsx supports IO_URING read/write, add IO_URING direct IO fsx
test with different read/write size and concurrent buffered IO.

Signed-off-by: Zorro Lang <zlang@redhat.com>
---
 tests/generic/610     | 52 +++++++++++++++++++++++++++++++++++++++++++
 tests/generic/610.out |  7 ++++++
 tests/generic/group   |  1 +
 3 files changed, 60 insertions(+)
 create mode 100755 tests/generic/610
 create mode 100644 tests/generic/610.out

diff --git a/tests/generic/610 b/tests/generic/610
new file mode 100755
index 00000000..fc3f4c2a
--- /dev/null
+++ b/tests/generic/610
@@ -0,0 +1,52 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2020 YOUR NAME HERE.  All Rights Reserved.
+#
+# FS QA Test 610
+#
+# IO_URING direct IO fsx test
+#
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1	# failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+	cd /
+	rm -f $tmp.*
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+
+# remove previous $seqres.full before test
+rm -f $seqres.full
+
+# real QA test starts here
+_supported_fs generic
+_supported_os Linux
+_require_test
+_require_odirect
+_require_io_uring
+
+psize=`$here/src/feature -s`
+bsize=`_min_dio_alignment $TEST_DEV`
+run_fsx -S 0 -U -N 20000           -l 600000 -r PSIZE -w BSIZE -Z -R -W
+run_fsx -S 0 -U -N 20000 -o 8192   -l 600000 -r PSIZE -w BSIZE -Z -R -W
+run_fsx -S 0 -U -N 20000 -o 128000 -l 600000 -r PSIZE -w BSIZE -Z -R -W
+
+# change readbdy/writebdy to double page size
+psize=$((psize * 2))
+run_fsx -S 0 -U -N 20000           -l 600000 -r PSIZE -w PSIZE -Z -R -W
+run_fsx -S 0 -U -N 20000 -o 256000 -l 600000 -r PSIZE -w PSIZE -Z -R -W
+run_fsx -S 0 -U -N 20000 -o 128000 -l 600000 -r PSIZE -w BSIZE -Z -W
+
+# success, all done
+status=0
+exit
diff --git a/tests/generic/610.out b/tests/generic/610.out
new file mode 100644
index 00000000..97ad41a3
--- /dev/null
+++ b/tests/generic/610.out
@@ -0,0 +1,7 @@
+QA output created by 610
+fsx -S 0 -U -N 20000 -l 600000 -r PSIZE -w BSIZE -Z -R -W
+fsx -S 0 -U -N 20000 -o 8192 -l 600000 -r PSIZE -w BSIZE -Z -R -W
+fsx -S 0 -U -N 20000 -o 128000 -l 600000 -r PSIZE -w BSIZE -Z -R -W
+fsx -S 0 -U -N 20000 -l 600000 -r PSIZE -w PSIZE -Z -R -W
+fsx -S 0 -U -N 20000 -o 256000 -l 600000 -r PSIZE -w PSIZE -Z -R -W
+fsx -S 0 -U -N 20000 -o 128000 -l 600000 -r PSIZE -w BSIZE -Z -W
diff --git a/tests/generic/group b/tests/generic/group
index cf50f4a1..60280dc2 100644
--- a/tests/generic/group
+++ b/tests/generic/group
@@ -612,3 +612,4 @@
 607 auto attr quick dax
 608 auto attr quick dax
 609 auto rw io_uring
+610 auto rw io_uring
-- 
2.20.1


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

* Re: [PATCH 1/3] src/feature: add IO_URING feature checking
  2020-09-16 17:14 ` [PATCH 1/3] src/feature: add IO_URING feature checking Zorro Lang
@ 2020-10-02 18:19   ` Brian Foster
  0 siblings, 0 replies; 15+ messages in thread
From: Brian Foster @ 2020-10-02 18:19 UTC (permalink / raw)
  To: Zorro Lang; +Cc: fstests, io-uring

On Thu, Sep 17, 2020 at 01:14:41AM +0800, Zorro Lang wrote:
> IO_URING is a new feature for GNU/Linux system, if someone case of
> xfstests tests this feature, better to check if current system
> supports it, or need _notrun.
> 
> Signed-off-by: Zorro Lang <zlang@redhat.com>
> ---

Reviewed-by: Brian Foster <bfoster@redhat.com>

>  src/Makefile  |  4 ++++
>  src/feature.c | 41 ++++++++++++++++++++++++++++++++++++++---
>  2 files changed, 42 insertions(+), 3 deletions(-)
> 
> diff --git a/src/Makefile b/src/Makefile
> index 643c1916..f1422c5c 100644
> --- a/src/Makefile
> +++ b/src/Makefile
> @@ -65,6 +65,10 @@ SUBDIRS += aio-dio-regress
>  LLDLIBS += -laio
>  endif
>  
> +ifeq ($(HAVE_URING), true)
> +LLDLIBS += -luring
> +endif
> +
>  CFILES = $(TARGETS:=.c)
>  LDIRT = $(TARGETS) fssum
>  
> diff --git a/src/feature.c b/src/feature.c
> index a7eb7595..df550cf6 100644
> --- a/src/feature.c
> +++ b/src/feature.c
> @@ -19,6 +19,7 @@
>   *
>   * Test for machine features
>   *   -A  test whether AIO syscalls are available
> + *   -R  test whether IO_URING syscalls are available
>   *   -o  report a number of online cpus
>   *   -s  report pagesize
>   *   -w  report bits per long
> @@ -39,6 +40,10 @@
>  #include <libaio.h>
>  #endif
>  
> +#ifdef HAVE_LIBURING_H
> +#include <liburing.h>
> +#endif
> +
>  #ifndef USRQUOTA
>  #define USRQUOTA  0
>  #endif
> @@ -59,7 +64,7 @@ usage(void)
>  	fprintf(stderr, "Usage: feature [-v] -<q|u|g|p|U|G|P> <filesystem>\n");
>  	fprintf(stderr, "       feature [-v] -c <file>\n");
>  	fprintf(stderr, "       feature [-v] -t <file>\n");
> -	fprintf(stderr, "       feature -A | -o | -s | -w\n");
> +	fprintf(stderr, "       feature -A | -R | -o | -s | -w\n");
>  	exit(1);
>  }
>  
> @@ -215,6 +220,29 @@ check_aio_support(void)
>  #endif
>  }
>  
> +static int
> +check_uring_support(void)
> +{
> +#ifdef HAVE_LIBURING_H
> +	struct io_uring ring;
> +	int err;
> +
> +	err = io_uring_queue_init(1, &ring, 0);
> +	if (err == 0)
> +		return 0;
> +
> +	if (err == -ENOSYS) /* CONFIG_IO_URING=n */
> +		return 1;
> +
> +	fprintf(stderr, "unexpected error from io_uring_queue_init(): %s\n",
> +		strerror(-err));
> +	return 2;
> +#else
> +	/* liburing is unavailable, assume IO_URING is unsupported */
> +	return 1;
> +#endif
> +}
> +
>  
>  int
>  main(int argc, char **argv)
> @@ -228,6 +256,7 @@ main(int argc, char **argv)
>  	int	pflag = 0;
>  	int	Pflag = 0;
>  	int	qflag = 0;
> +	int	Rflag = 0;
>  	int	sflag = 0;
>  	int	uflag = 0;
>  	int	Uflag = 0;
> @@ -235,7 +264,7 @@ main(int argc, char **argv)
>  	int	oflag = 0;
>  	char	*fs = NULL;
>  
> -	while ((c = getopt(argc, argv, "ActgGopPqsuUvw")) != EOF) {
> +	while ((c = getopt(argc, argv, "ActgGopPqRsuUvw")) != EOF) {
>  		switch (c) {
>  		case 'A':
>  			Aflag++;
> @@ -264,6 +293,9 @@ main(int argc, char **argv)
>  		case 'q':
>  			qflag++;
>  			break;
> +		case 'R':
> +			Rflag++;
> +			break;
>  		case 's':
>  			sflag++;
>  			break;
> @@ -289,7 +321,7 @@ main(int argc, char **argv)
>  		if (optind != argc-1)	/* need a device */
>  			usage();
>  		fs = argv[argc-1];
> -	} else if (Aflag || wflag || sflag || oflag) {
> +	} else if (Aflag || Rflag || wflag || sflag || oflag) {
>  		if (optind != argc)
>  			usage();
>  	} else 
> @@ -317,6 +349,9 @@ main(int argc, char **argv)
>  	if (Aflag)
>  		return(check_aio_support());
>  
> +	if (Rflag)
> +		return(check_uring_support());
> +
>  	if (sflag) {
>  		printf("%d\n", getpagesize());
>  		exit(0);
> -- 
> 2.20.1
> 


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

* Re: [PATCH 2/3] generic: fsx IO_URING soak tests
  2020-09-16 17:14 ` [PATCH 2/3] generic: fsx IO_URING soak tests Zorro Lang
@ 2020-10-02 18:20   ` Brian Foster
  0 siblings, 0 replies; 15+ messages in thread
From: Brian Foster @ 2020-10-02 18:20 UTC (permalink / raw)
  To: Zorro Lang; +Cc: fstests, io-uring

On Thu, Sep 17, 2020 at 01:14:42AM +0800, Zorro Lang wrote:
> After fsx supports IO_URING read/write, add a test to do IO_URING
> soak test of fsx.
> 
> Signed-off-by: Zorro Lang <zlang@redhat.com>
> ---
>  common/rc             | 16 ++++++++++++
>  tests/generic/609     | 58 +++++++++++++++++++++++++++++++++++++++++++
>  tests/generic/609.out |  2 ++
>  tests/generic/group   |  1 +
>  4 files changed, 77 insertions(+)
>  create mode 100755 tests/generic/609
>  create mode 100644 tests/generic/609.out
> 
...
> diff --git a/tests/generic/609 b/tests/generic/609
> new file mode 100755
> index 00000000..1d9b6fed
> --- /dev/null
> +++ b/tests/generic/609
> @@ -0,0 +1,58 @@
> +#! /bin/bash
> +# SPDX-License-Identifier: GPL-2.0
> +# Copyright (c) 2020 Red Hat Inc.  All Rights Reserved.
> +#
> +# FS QA Test 609
> +#
> +# IO_URING soak buffered fsx test
> +#
> +seq=`basename $0`
> +seqres=$RESULT_DIR/$seq
> +echo "QA output created by $seq"
> +
> +here=`pwd`
> +tmp=/tmp/$$
> +status=1	# failure is the default!
> +trap "_cleanup; exit \$status" 0 1 2 3 15
> +
> +_cleanup()
> +{
> +	cd /
> +	rm -f $tmp.*
> +}
> +
> +# get standard environment, filters and checks
> +. ./common/rc
> +. ./common/filter
> +
> +# remove previous $seqres.full before test
> +rm -f $seqres.full
> +
> +# real QA test starts here
> +
> +# Modify as appropriate.
> +_supported_fs generic
> +_supported_os Linux
> +_require_test
> +_require_io_uring
> +
> +# Run fsx for a million ops or more
> +nr_ops=$((100000 * TIME_FACTOR))

The value used here doesn't match the comment. Though it looks like this
is modeled after generic/512, which does specify 1m ops, but also isn't
included in the auto group presumably due to the time required to run
the test.

Brian

> +op_sz=$((128000 * LOAD_FACTOR))
> +file_sz=$((600000 * LOAD_FACTOR))
> +fsx_file=$TEST_DIR/fsx.$seq
> +
> +fsx_args=(-S 0)
> +fsx_args+=(-U)
> +fsx_args+=(-q)
> +fsx_args+=(-N $nr_ops)
> +fsx_args+=(-p $((nr_ops / 100)))
> +fsx_args+=(-o $op_sz)
> +fsx_args+=(-l $file_sz)
> +
> +run_fsx "${fsx_args[@]}" | sed -e '/^fsx.*/d'
> +
> +# success, all done
> +echo "Silence is golden"
> +status=0
> +exit
> diff --git a/tests/generic/609.out b/tests/generic/609.out
> new file mode 100644
> index 00000000..0d75b384
> --- /dev/null
> +++ b/tests/generic/609.out
> @@ -0,0 +1,2 @@
> +QA output created by 609
> +Silence is golden
> diff --git a/tests/generic/group b/tests/generic/group
> index aa969bcb..cf50f4a1 100644
> --- a/tests/generic/group
> +++ b/tests/generic/group
> @@ -611,3 +611,4 @@
>  606 auto attr quick dax
>  607 auto attr quick dax
>  608 auto attr quick dax
> +609 auto rw io_uring
> -- 
> 2.20.1
> 


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

* Re: [PATCH 3/3] generic: IO_URING direct IO fsx test
  2020-09-16 17:14 ` [PATCH 3/3] generic: IO_URING direct IO fsx test Zorro Lang
@ 2020-10-02 18:20   ` Brian Foster
  2020-10-11 12:15     ` Zorro Lang
  2020-10-05 16:45   ` Darrick J. Wong
  1 sibling, 1 reply; 15+ messages in thread
From: Brian Foster @ 2020-10-02 18:20 UTC (permalink / raw)
  To: Zorro Lang; +Cc: fstests, io-uring

On Thu, Sep 17, 2020 at 01:14:43AM +0800, Zorro Lang wrote:
> After fsx supports IO_URING read/write, add IO_URING direct IO fsx
> test with different read/write size and concurrent buffered IO.
> 
> Signed-off-by: Zorro Lang <zlang@redhat.com>
> ---
>  tests/generic/610     | 52 +++++++++++++++++++++++++++++++++++++++++++
>  tests/generic/610.out |  7 ++++++
>  tests/generic/group   |  1 +
>  3 files changed, 60 insertions(+)
>  create mode 100755 tests/generic/610
>  create mode 100644 tests/generic/610.out
> 
> diff --git a/tests/generic/610 b/tests/generic/610
> new file mode 100755
> index 00000000..fc3f4c2a
> --- /dev/null
> +++ b/tests/generic/610
> @@ -0,0 +1,52 @@
> +#! /bin/bash
> +# SPDX-License-Identifier: GPL-2.0
> +# Copyright (c) 2020 YOUR NAME HERE.  All Rights Reserved.

The copyright needs fixing.

> +#
> +# FS QA Test 610
> +#
> +# IO_URING direct IO fsx test
> +#
> +seq=`basename $0`
> +seqres=$RESULT_DIR/$seq
> +echo "QA output created by $seq"
> +
> +here=`pwd`
> +tmp=/tmp/$$
> +status=1	# failure is the default!
> +trap "_cleanup; exit \$status" 0 1 2 3 15
> +
> +_cleanup()
> +{
> +	cd /
> +	rm -f $tmp.*
> +}
> +
> +# get standard environment, filters and checks
> +. ./common/rc
> +. ./common/filter
> +
> +# remove previous $seqres.full before test
> +rm -f $seqres.full
> +
> +# real QA test starts here
> +_supported_fs generic
> +_supported_os Linux
> +_require_test
> +_require_odirect
> +_require_io_uring
> +
> +psize=`$here/src/feature -s`
> +bsize=`_min_dio_alignment $TEST_DEV`
> +run_fsx -S 0 -U -N 20000           -l 600000 -r PSIZE -w BSIZE -Z -R -W
> +run_fsx -S 0 -U -N 20000 -o 8192   -l 600000 -r PSIZE -w BSIZE -Z -R -W
> +run_fsx -S 0 -U -N 20000 -o 128000 -l 600000 -r PSIZE -w BSIZE -Z -R -W
> +
> +# change readbdy/writebdy to double page size
> +psize=$((psize * 2))
> +run_fsx -S 0 -U -N 20000           -l 600000 -r PSIZE -w PSIZE -Z -R -W
> +run_fsx -S 0 -U -N 20000 -o 256000 -l 600000 -r PSIZE -w PSIZE -Z -R -W
> +run_fsx -S 0 -U -N 20000 -o 128000 -l 600000 -r PSIZE -w BSIZE -Z -W
> +

Can you elaborate on why PSIZE/BSIZE are used where they are for the
writebdy option? Also is -R intentionally dropped from the final test?

Brian

> +# success, all done
> +status=0
> +exit
> diff --git a/tests/generic/610.out b/tests/generic/610.out
> new file mode 100644
> index 00000000..97ad41a3
> --- /dev/null
> +++ b/tests/generic/610.out
> @@ -0,0 +1,7 @@
> +QA output created by 610
> +fsx -S 0 -U -N 20000 -l 600000 -r PSIZE -w BSIZE -Z -R -W
> +fsx -S 0 -U -N 20000 -o 8192 -l 600000 -r PSIZE -w BSIZE -Z -R -W
> +fsx -S 0 -U -N 20000 -o 128000 -l 600000 -r PSIZE -w BSIZE -Z -R -W
> +fsx -S 0 -U -N 20000 -l 600000 -r PSIZE -w PSIZE -Z -R -W
> +fsx -S 0 -U -N 20000 -o 256000 -l 600000 -r PSIZE -w PSIZE -Z -R -W
> +fsx -S 0 -U -N 20000 -o 128000 -l 600000 -r PSIZE -w BSIZE -Z -W
> diff --git a/tests/generic/group b/tests/generic/group
> index cf50f4a1..60280dc2 100644
> --- a/tests/generic/group
> +++ b/tests/generic/group
> @@ -612,3 +612,4 @@
>  607 auto attr quick dax
>  608 auto attr quick dax
>  609 auto rw io_uring
> +610 auto rw io_uring
> -- 
> 2.20.1
> 


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

* Re: [PATCH 3/3] generic: IO_URING direct IO fsx test
  2020-09-16 17:14 ` [PATCH 3/3] generic: IO_URING direct IO fsx test Zorro Lang
  2020-10-02 18:20   ` Brian Foster
@ 2020-10-05 16:45   ` Darrick J. Wong
  2020-10-11 12:36     ` Zorro Lang
  1 sibling, 1 reply; 15+ messages in thread
From: Darrick J. Wong @ 2020-10-05 16:45 UTC (permalink / raw)
  To: Zorro Lang; +Cc: fstests, io-uring

On Thu, Sep 17, 2020 at 01:14:43AM +0800, Zorro Lang wrote:
> After fsx supports IO_URING read/write, add IO_URING direct IO fsx
> test with different read/write size and concurrent buffered IO.
> 
> Signed-off-by: Zorro Lang <zlang@redhat.com>

Funny, I would have expected this to be a clone of generic/521, much
like the previous test was a clone of g/522.  I guess it's fine to test
various fsx parameters, but in that case, is there a reason /not/ to
have a long soak io_uring directio test?

--D

> ---
>  tests/generic/610     | 52 +++++++++++++++++++++++++++++++++++++++++++
>  tests/generic/610.out |  7 ++++++
>  tests/generic/group   |  1 +
>  3 files changed, 60 insertions(+)
>  create mode 100755 tests/generic/610
>  create mode 100644 tests/generic/610.out
> 
> diff --git a/tests/generic/610 b/tests/generic/610
> new file mode 100755
> index 00000000..fc3f4c2a
> --- /dev/null
> +++ b/tests/generic/610
> @@ -0,0 +1,52 @@
> +#! /bin/bash
> +# SPDX-License-Identifier: GPL-2.0
> +# Copyright (c) 2020 YOUR NAME HERE.  All Rights Reserved.
> +#
> +# FS QA Test 610
> +#
> +# IO_URING direct IO fsx test
> +#
> +seq=`basename $0`
> +seqres=$RESULT_DIR/$seq
> +echo "QA output created by $seq"
> +
> +here=`pwd`
> +tmp=/tmp/$$
> +status=1	# failure is the default!
> +trap "_cleanup; exit \$status" 0 1 2 3 15
> +
> +_cleanup()
> +{
> +	cd /
> +	rm -f $tmp.*
> +}
> +
> +# get standard environment, filters and checks
> +. ./common/rc
> +. ./common/filter
> +
> +# remove previous $seqres.full before test
> +rm -f $seqres.full
> +
> +# real QA test starts here
> +_supported_fs generic
> +_supported_os Linux
> +_require_test
> +_require_odirect
> +_require_io_uring
> +
> +psize=`$here/src/feature -s`
> +bsize=`_min_dio_alignment $TEST_DEV`
> +run_fsx -S 0 -U -N 20000           -l 600000 -r PSIZE -w BSIZE -Z -R -W
> +run_fsx -S 0 -U -N 20000 -o 8192   -l 600000 -r PSIZE -w BSIZE -Z -R -W
> +run_fsx -S 0 -U -N 20000 -o 128000 -l 600000 -r PSIZE -w BSIZE -Z -R -W
> +
> +# change readbdy/writebdy to double page size
> +psize=$((psize * 2))
> +run_fsx -S 0 -U -N 20000           -l 600000 -r PSIZE -w PSIZE -Z -R -W
> +run_fsx -S 0 -U -N 20000 -o 256000 -l 600000 -r PSIZE -w PSIZE -Z -R -W
> +run_fsx -S 0 -U -N 20000 -o 128000 -l 600000 -r PSIZE -w BSIZE -Z -W
> +
> +# success, all done
> +status=0
> +exit
> diff --git a/tests/generic/610.out b/tests/generic/610.out
> new file mode 100644
> index 00000000..97ad41a3
> --- /dev/null
> +++ b/tests/generic/610.out
> @@ -0,0 +1,7 @@
> +QA output created by 610
> +fsx -S 0 -U -N 20000 -l 600000 -r PSIZE -w BSIZE -Z -R -W
> +fsx -S 0 -U -N 20000 -o 8192 -l 600000 -r PSIZE -w BSIZE -Z -R -W
> +fsx -S 0 -U -N 20000 -o 128000 -l 600000 -r PSIZE -w BSIZE -Z -R -W
> +fsx -S 0 -U -N 20000 -l 600000 -r PSIZE -w PSIZE -Z -R -W
> +fsx -S 0 -U -N 20000 -o 256000 -l 600000 -r PSIZE -w PSIZE -Z -R -W
> +fsx -S 0 -U -N 20000 -o 128000 -l 600000 -r PSIZE -w BSIZE -Z -W
> diff --git a/tests/generic/group b/tests/generic/group
> index cf50f4a1..60280dc2 100644
> --- a/tests/generic/group
> +++ b/tests/generic/group
> @@ -612,3 +612,4 @@
>  607 auto attr quick dax
>  608 auto attr quick dax
>  609 auto rw io_uring
> +610 auto rw io_uring
> -- 
> 2.20.1
> 

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

* Re: [PATCH 3/3] generic: IO_URING direct IO fsx test
  2020-10-02 18:20   ` Brian Foster
@ 2020-10-11 12:15     ` Zorro Lang
  2020-10-12 17:55       ` Brian Foster
  0 siblings, 1 reply; 15+ messages in thread
From: Zorro Lang @ 2020-10-11 12:15 UTC (permalink / raw)
  To: Brian Foster; +Cc: fstests

On Fri, Oct 02, 2020 at 02:20:31PM -0400, Brian Foster wrote:
> On Thu, Sep 17, 2020 at 01:14:43AM +0800, Zorro Lang wrote:
> > After fsx supports IO_URING read/write, add IO_URING direct IO fsx
> > test with different read/write size and concurrent buffered IO.
> > 
> > Signed-off-by: Zorro Lang <zlang@redhat.com>
> > ---
> >  tests/generic/610     | 52 +++++++++++++++++++++++++++++++++++++++++++
> >  tests/generic/610.out |  7 ++++++
> >  tests/generic/group   |  1 +
> >  3 files changed, 60 insertions(+)
> >  create mode 100755 tests/generic/610
> >  create mode 100644 tests/generic/610.out
> > 
> > diff --git a/tests/generic/610 b/tests/generic/610
> > new file mode 100755
> > index 00000000..fc3f4c2a
> > --- /dev/null
> > +++ b/tests/generic/610
> > @@ -0,0 +1,52 @@
> > +#! /bin/bash
> > +# SPDX-License-Identifier: GPL-2.0
> > +# Copyright (c) 2020 YOUR NAME HERE.  All Rights Reserved.
> 
> The copyright needs fixing.
> 
> > +#
> > +# FS QA Test 610
> > +#
> > +# IO_URING direct IO fsx test
> > +#
> > +seq=`basename $0`
> > +seqres=$RESULT_DIR/$seq
> > +echo "QA output created by $seq"
> > +
> > +here=`pwd`
> > +tmp=/tmp/$$
> > +status=1	# failure is the default!
> > +trap "_cleanup; exit \$status" 0 1 2 3 15
> > +
> > +_cleanup()
> > +{
> > +	cd /
> > +	rm -f $tmp.*
> > +}
> > +
> > +# get standard environment, filters and checks
> > +. ./common/rc
> > +. ./common/filter
> > +
> > +# remove previous $seqres.full before test
> > +rm -f $seqres.full
> > +
> > +# real QA test starts here
> > +_supported_fs generic
> > +_supported_os Linux
> > +_require_test
> > +_require_odirect
> > +_require_io_uring
> > +
> > +psize=`$here/src/feature -s`
> > +bsize=`_min_dio_alignment $TEST_DEV`
> > +run_fsx -S 0 -U -N 20000           -l 600000 -r PSIZE -w BSIZE -Z -R -W
> > +run_fsx -S 0 -U -N 20000 -o 8192   -l 600000 -r PSIZE -w BSIZE -Z -R -W
> > +run_fsx -S 0 -U -N 20000 -o 128000 -l 600000 -r PSIZE -w BSIZE -Z -R -W
> > +
> > +# change readbdy/writebdy to double page size
> > +psize=$((psize * 2))
> > +run_fsx -S 0 -U -N 20000           -l 600000 -r PSIZE -w PSIZE -Z -R -W
> > +run_fsx -S 0 -U -N 20000 -o 256000 -l 600000 -r PSIZE -w PSIZE -Z -R -W
> > +run_fsx -S 0 -U -N 20000 -o 128000 -l 600000 -r PSIZE -w BSIZE -Z -W
> > +
> 
> Can you elaborate on why PSIZE/BSIZE are used where they are for the
> writebdy option? Also is -R intentionally dropped from the final test?

Sure:) This test is copied from generic/091.

> 
> Brian
> 
> > +# success, all done
> > +status=0
> > +exit
> > diff --git a/tests/generic/610.out b/tests/generic/610.out
> > new file mode 100644
> > index 00000000..97ad41a3
> > --- /dev/null
> > +++ b/tests/generic/610.out
> > @@ -0,0 +1,7 @@
> > +QA output created by 610
> > +fsx -S 0 -U -N 20000 -l 600000 -r PSIZE -w BSIZE -Z -R -W
> > +fsx -S 0 -U -N 20000 -o 8192 -l 600000 -r PSIZE -w BSIZE -Z -R -W
> > +fsx -S 0 -U -N 20000 -o 128000 -l 600000 -r PSIZE -w BSIZE -Z -R -W
> > +fsx -S 0 -U -N 20000 -l 600000 -r PSIZE -w PSIZE -Z -R -W
> > +fsx -S 0 -U -N 20000 -o 256000 -l 600000 -r PSIZE -w PSIZE -Z -R -W
> > +fsx -S 0 -U -N 20000 -o 128000 -l 600000 -r PSIZE -w BSIZE -Z -W
> > diff --git a/tests/generic/group b/tests/generic/group
> > index cf50f4a1..60280dc2 100644
> > --- a/tests/generic/group
> > +++ b/tests/generic/group
> > @@ -612,3 +612,4 @@
> >  607 auto attr quick dax
> >  608 auto attr quick dax
> >  609 auto rw io_uring
> > +610 auto rw io_uring
> > -- 
> > 2.20.1
> > 


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

* Re: [PATCH 3/3] generic: IO_URING direct IO fsx test
  2020-10-05 16:45   ` Darrick J. Wong
@ 2020-10-11 12:36     ` Zorro Lang
  0 siblings, 0 replies; 15+ messages in thread
From: Zorro Lang @ 2020-10-11 12:36 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: fstests

On Mon, Oct 05, 2020 at 09:45:10AM -0700, Darrick J. Wong wrote:
> On Thu, Sep 17, 2020 at 01:14:43AM +0800, Zorro Lang wrote:
> > After fsx supports IO_URING read/write, add IO_URING direct IO fsx
> > test with different read/write size and concurrent buffered IO.
> > 
> > Signed-off-by: Zorro Lang <zlang@redhat.com>
> 
> Funny, I would have expected this to be a clone of generic/521, much
> like the previous test was a clone of g/522.  I guess it's fine to test
> various fsx parameters, but in that case, is there a reason /not/ to
> have a long soak io_uring directio test?

This case is copied from generic/091 :) Even the previous test was a clone
of g/522, but I reduce the default test time. The g/521 and g/522 takes too long
time, I'd like to have io_uring buffer and direct IO basic test cases which
doesn't take long time at first. From this side, I think g/091 does more test :-p

Thanks,
Zorro

> 
> --D
> 
> > ---
> >  tests/generic/610     | 52 +++++++++++++++++++++++++++++++++++++++++++
> >  tests/generic/610.out |  7 ++++++
> >  tests/generic/group   |  1 +
> >  3 files changed, 60 insertions(+)
> >  create mode 100755 tests/generic/610
> >  create mode 100644 tests/generic/610.out
> > 
> > diff --git a/tests/generic/610 b/tests/generic/610
> > new file mode 100755
> > index 00000000..fc3f4c2a
> > --- /dev/null
> > +++ b/tests/generic/610
> > @@ -0,0 +1,52 @@
> > +#! /bin/bash
> > +# SPDX-License-Identifier: GPL-2.0
> > +# Copyright (c) 2020 YOUR NAME HERE.  All Rights Reserved.
> > +#
> > +# FS QA Test 610
> > +#
> > +# IO_URING direct IO fsx test
> > +#
> > +seq=`basename $0`
> > +seqres=$RESULT_DIR/$seq
> > +echo "QA output created by $seq"
> > +
> > +here=`pwd`
> > +tmp=/tmp/$$
> > +status=1	# failure is the default!
> > +trap "_cleanup; exit \$status" 0 1 2 3 15
> > +
> > +_cleanup()
> > +{
> > +	cd /
> > +	rm -f $tmp.*
> > +}
> > +
> > +# get standard environment, filters and checks
> > +. ./common/rc
> > +. ./common/filter
> > +
> > +# remove previous $seqres.full before test
> > +rm -f $seqres.full
> > +
> > +# real QA test starts here
> > +_supported_fs generic
> > +_supported_os Linux
> > +_require_test
> > +_require_odirect
> > +_require_io_uring
> > +
> > +psize=`$here/src/feature -s`
> > +bsize=`_min_dio_alignment $TEST_DEV`
> > +run_fsx -S 0 -U -N 20000           -l 600000 -r PSIZE -w BSIZE -Z -R -W
> > +run_fsx -S 0 -U -N 20000 -o 8192   -l 600000 -r PSIZE -w BSIZE -Z -R -W
> > +run_fsx -S 0 -U -N 20000 -o 128000 -l 600000 -r PSIZE -w BSIZE -Z -R -W
> > +
> > +# change readbdy/writebdy to double page size
> > +psize=$((psize * 2))
> > +run_fsx -S 0 -U -N 20000           -l 600000 -r PSIZE -w PSIZE -Z -R -W
> > +run_fsx -S 0 -U -N 20000 -o 256000 -l 600000 -r PSIZE -w PSIZE -Z -R -W
> > +run_fsx -S 0 -U -N 20000 -o 128000 -l 600000 -r PSIZE -w BSIZE -Z -W
> > +
> > +# success, all done
> > +status=0
> > +exit
> > diff --git a/tests/generic/610.out b/tests/generic/610.out
> > new file mode 100644
> > index 00000000..97ad41a3
> > --- /dev/null
> > +++ b/tests/generic/610.out
> > @@ -0,0 +1,7 @@
> > +QA output created by 610
> > +fsx -S 0 -U -N 20000 -l 600000 -r PSIZE -w BSIZE -Z -R -W
> > +fsx -S 0 -U -N 20000 -o 8192 -l 600000 -r PSIZE -w BSIZE -Z -R -W
> > +fsx -S 0 -U -N 20000 -o 128000 -l 600000 -r PSIZE -w BSIZE -Z -R -W
> > +fsx -S 0 -U -N 20000 -l 600000 -r PSIZE -w PSIZE -Z -R -W
> > +fsx -S 0 -U -N 20000 -o 256000 -l 600000 -r PSIZE -w PSIZE -Z -R -W
> > +fsx -S 0 -U -N 20000 -o 128000 -l 600000 -r PSIZE -w BSIZE -Z -W
> > diff --git a/tests/generic/group b/tests/generic/group
> > index cf50f4a1..60280dc2 100644
> > --- a/tests/generic/group
> > +++ b/tests/generic/group
> > @@ -612,3 +612,4 @@
> >  607 auto attr quick dax
> >  608 auto attr quick dax
> >  609 auto rw io_uring
> > +610 auto rw io_uring
> > -- 
> > 2.20.1
> > 
> 


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

* Re: [PATCH 3/3] generic: IO_URING direct IO fsx test
  2020-10-11 12:15     ` Zorro Lang
@ 2020-10-12 17:55       ` Brian Foster
  0 siblings, 0 replies; 15+ messages in thread
From: Brian Foster @ 2020-10-12 17:55 UTC (permalink / raw)
  To: fstests

On Sun, Oct 11, 2020 at 08:15:20PM +0800, Zorro Lang wrote:
> On Fri, Oct 02, 2020 at 02:20:31PM -0400, Brian Foster wrote:
> > On Thu, Sep 17, 2020 at 01:14:43AM +0800, Zorro Lang wrote:
> > > After fsx supports IO_URING read/write, add IO_URING direct IO fsx
> > > test with different read/write size and concurrent buffered IO.
> > > 
> > > Signed-off-by: Zorro Lang <zlang@redhat.com>
> > > ---
> > >  tests/generic/610     | 52 +++++++++++++++++++++++++++++++++++++++++++
> > >  tests/generic/610.out |  7 ++++++
> > >  tests/generic/group   |  1 +
> > >  3 files changed, 60 insertions(+)
> > >  create mode 100755 tests/generic/610
> > >  create mode 100644 tests/generic/610.out
> > > 
> > > diff --git a/tests/generic/610 b/tests/generic/610
> > > new file mode 100755
> > > index 00000000..fc3f4c2a
> > > --- /dev/null
> > > +++ b/tests/generic/610
> > > @@ -0,0 +1,52 @@
> > > +#! /bin/bash
> > > +# SPDX-License-Identifier: GPL-2.0
> > > +# Copyright (c) 2020 YOUR NAME HERE.  All Rights Reserved.
> > 
> > The copyright needs fixing.
> > 
> > > +#
> > > +# FS QA Test 610
> > > +#
> > > +# IO_URING direct IO fsx test
> > > +#
> > > +seq=`basename $0`
> > > +seqres=$RESULT_DIR/$seq
> > > +echo "QA output created by $seq"
> > > +
> > > +here=`pwd`
> > > +tmp=/tmp/$$
> > > +status=1	# failure is the default!
> > > +trap "_cleanup; exit \$status" 0 1 2 3 15
> > > +
> > > +_cleanup()
> > > +{
> > > +	cd /
> > > +	rm -f $tmp.*
> > > +}
> > > +
> > > +# get standard environment, filters and checks
> > > +. ./common/rc
> > > +. ./common/filter
> > > +
> > > +# remove previous $seqres.full before test
> > > +rm -f $seqres.full
> > > +
> > > +# real QA test starts here
> > > +_supported_fs generic
> > > +_supported_os Linux
> > > +_require_test
> > > +_require_odirect
> > > +_require_io_uring
> > > +
> > > +psize=`$here/src/feature -s`
> > > +bsize=`_min_dio_alignment $TEST_DEV`
> > > +run_fsx -S 0 -U -N 20000           -l 600000 -r PSIZE -w BSIZE -Z -R -W
> > > +run_fsx -S 0 -U -N 20000 -o 8192   -l 600000 -r PSIZE -w BSIZE -Z -R -W
> > > +run_fsx -S 0 -U -N 20000 -o 128000 -l 600000 -r PSIZE -w BSIZE -Z -R -W
> > > +
> > > +# change readbdy/writebdy to double page size
> > > +psize=$((psize * 2))
> > > +run_fsx -S 0 -U -N 20000           -l 600000 -r PSIZE -w PSIZE -Z -R -W
> > > +run_fsx -S 0 -U -N 20000 -o 256000 -l 600000 -r PSIZE -w PSIZE -Z -R -W
> > > +run_fsx -S 0 -U -N 20000 -o 128000 -l 600000 -r PSIZE -w BSIZE -Z -W
> > > +
> > 
> > Can you elaborate on why PSIZE/BSIZE are used where they are for the
> > writebdy option? Also is -R intentionally dropped from the final test?
> 
> Sure:) This test is copied from generic/091.
> 

Hmm.. but generic/091 doesn't seem to use the same values and always
passes a writebdy of BSIZE (at least for the tests that aren't commented
out). It kind of looks like this tweaks some values across the board,
then randomly selects some of the commented and non-commented test
commands without any explanation.

Brian

> > 
> > Brian
> > 
> > > +# success, all done
> > > +status=0
> > > +exit
> > > diff --git a/tests/generic/610.out b/tests/generic/610.out
> > > new file mode 100644
> > > index 00000000..97ad41a3
> > > --- /dev/null
> > > +++ b/tests/generic/610.out
> > > @@ -0,0 +1,7 @@
> > > +QA output created by 610
> > > +fsx -S 0 -U -N 20000 -l 600000 -r PSIZE -w BSIZE -Z -R -W
> > > +fsx -S 0 -U -N 20000 -o 8192 -l 600000 -r PSIZE -w BSIZE -Z -R -W
> > > +fsx -S 0 -U -N 20000 -o 128000 -l 600000 -r PSIZE -w BSIZE -Z -R -W
> > > +fsx -S 0 -U -N 20000 -l 600000 -r PSIZE -w PSIZE -Z -R -W
> > > +fsx -S 0 -U -N 20000 -o 256000 -l 600000 -r PSIZE -w PSIZE -Z -R -W
> > > +fsx -S 0 -U -N 20000 -o 128000 -l 600000 -r PSIZE -w BSIZE -Z -W
> > > diff --git a/tests/generic/group b/tests/generic/group
> > > index cf50f4a1..60280dc2 100644
> > > --- a/tests/generic/group
> > > +++ b/tests/generic/group
> > > @@ -612,3 +612,4 @@
> > >  607 auto attr quick dax
> > >  608 auto attr quick dax
> > >  609 auto rw io_uring
> > > +610 auto rw io_uring
> > > -- 
> > > 2.20.1
> > > 
> 


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

* [PATCH 1/3] src/feature: add IO_URING feature checking
  2020-11-08 12:26 [PATCH 0/3] xfstests: fsx IO_URING test cases Zorro Lang
@ 2020-11-08 12:26 ` Zorro Lang
  0 siblings, 0 replies; 15+ messages in thread
From: Zorro Lang @ 2020-11-08 12:26 UTC (permalink / raw)
  To: fstests

IO_URING is a new feature for GNU/Linux system, if someone case of
xfstests tests this feature, better to check if current system
supports it, or need _notrun.

Signed-off-by: Zorro Lang <zlang@redhat.com>
---
 src/Makefile  |  4 ++++
 src/feature.c | 41 ++++++++++++++++++++++++++++++++++++++---
 2 files changed, 42 insertions(+), 3 deletions(-)

diff --git a/src/Makefile b/src/Makefile
index 643c1916..f1422c5c 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -65,6 +65,10 @@ SUBDIRS += aio-dio-regress
 LLDLIBS += -laio
 endif
 
+ifeq ($(HAVE_URING), true)
+LLDLIBS += -luring
+endif
+
 CFILES = $(TARGETS:=.c)
 LDIRT = $(TARGETS) fssum
 
diff --git a/src/feature.c b/src/feature.c
index a7eb7595..df550cf6 100644
--- a/src/feature.c
+++ b/src/feature.c
@@ -19,6 +19,7 @@
  *
  * Test for machine features
  *   -A  test whether AIO syscalls are available
+ *   -R  test whether IO_URING syscalls are available
  *   -o  report a number of online cpus
  *   -s  report pagesize
  *   -w  report bits per long
@@ -39,6 +40,10 @@
 #include <libaio.h>
 #endif
 
+#ifdef HAVE_LIBURING_H
+#include <liburing.h>
+#endif
+
 #ifndef USRQUOTA
 #define USRQUOTA  0
 #endif
@@ -59,7 +64,7 @@ usage(void)
 	fprintf(stderr, "Usage: feature [-v] -<q|u|g|p|U|G|P> <filesystem>\n");
 	fprintf(stderr, "       feature [-v] -c <file>\n");
 	fprintf(stderr, "       feature [-v] -t <file>\n");
-	fprintf(stderr, "       feature -A | -o | -s | -w\n");
+	fprintf(stderr, "       feature -A | -R | -o | -s | -w\n");
 	exit(1);
 }
 
@@ -215,6 +220,29 @@ check_aio_support(void)
 #endif
 }
 
+static int
+check_uring_support(void)
+{
+#ifdef HAVE_LIBURING_H
+	struct io_uring ring;
+	int err;
+
+	err = io_uring_queue_init(1, &ring, 0);
+	if (err == 0)
+		return 0;
+
+	if (err == -ENOSYS) /* CONFIG_IO_URING=n */
+		return 1;
+
+	fprintf(stderr, "unexpected error from io_uring_queue_init(): %s\n",
+		strerror(-err));
+	return 2;
+#else
+	/* liburing is unavailable, assume IO_URING is unsupported */
+	return 1;
+#endif
+}
+
 
 int
 main(int argc, char **argv)
@@ -228,6 +256,7 @@ main(int argc, char **argv)
 	int	pflag = 0;
 	int	Pflag = 0;
 	int	qflag = 0;
+	int	Rflag = 0;
 	int	sflag = 0;
 	int	uflag = 0;
 	int	Uflag = 0;
@@ -235,7 +264,7 @@ main(int argc, char **argv)
 	int	oflag = 0;
 	char	*fs = NULL;
 
-	while ((c = getopt(argc, argv, "ActgGopPqsuUvw")) != EOF) {
+	while ((c = getopt(argc, argv, "ActgGopPqRsuUvw")) != EOF) {
 		switch (c) {
 		case 'A':
 			Aflag++;
@@ -264,6 +293,9 @@ main(int argc, char **argv)
 		case 'q':
 			qflag++;
 			break;
+		case 'R':
+			Rflag++;
+			break;
 		case 's':
 			sflag++;
 			break;
@@ -289,7 +321,7 @@ main(int argc, char **argv)
 		if (optind != argc-1)	/* need a device */
 			usage();
 		fs = argv[argc-1];
-	} else if (Aflag || wflag || sflag || oflag) {
+	} else if (Aflag || Rflag || wflag || sflag || oflag) {
 		if (optind != argc)
 			usage();
 	} else 
@@ -317,6 +349,9 @@ main(int argc, char **argv)
 	if (Aflag)
 		return(check_aio_support());
 
+	if (Rflag)
+		return(check_uring_support());
+
 	if (sflag) {
 		printf("%d\n", getpagesize());
 		exit(0);
-- 
2.25.4


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

* [PATCH 1/3] src/feature: add IO_URING feature checking
  2020-09-16 13:11 [PATCH 0/3] xfstests: new io_uring fsx test Zorro Lang
@ 2020-09-16 13:11 ` Zorro Lang
  0 siblings, 0 replies; 15+ messages in thread
From: Zorro Lang @ 2020-09-16 13:11 UTC (permalink / raw)
  To: fstests; +Cc: io-uring

IO_URING is a new feature for GNU/Linux system, if someone case of
xfstests tests this feature, better to check if current system
supports it, or need _notrun.

Signed-off-by: Zorro Lang <zlang@redhat.com>
---
 src/Makefile  |  4 ++++
 src/feature.c | 41 ++++++++++++++++++++++++++++++++++++++---
 2 files changed, 42 insertions(+), 3 deletions(-)

diff --git a/src/Makefile b/src/Makefile
index 643c1916..f1422c5c 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -65,6 +65,10 @@ SUBDIRS += aio-dio-regress
 LLDLIBS += -laio
 endif
 
+ifeq ($(HAVE_URING), true)
+LLDLIBS += -luring
+endif
+
 CFILES = $(TARGETS:=.c)
 LDIRT = $(TARGETS) fssum
 
diff --git a/src/feature.c b/src/feature.c
index a7eb7595..df550cf6 100644
--- a/src/feature.c
+++ b/src/feature.c
@@ -19,6 +19,7 @@
  *
  * Test for machine features
  *   -A  test whether AIO syscalls are available
+ *   -R  test whether IO_URING syscalls are available
  *   -o  report a number of online cpus
  *   -s  report pagesize
  *   -w  report bits per long
@@ -39,6 +40,10 @@
 #include <libaio.h>
 #endif
 
+#ifdef HAVE_LIBURING_H
+#include <liburing.h>
+#endif
+
 #ifndef USRQUOTA
 #define USRQUOTA  0
 #endif
@@ -59,7 +64,7 @@ usage(void)
 	fprintf(stderr, "Usage: feature [-v] -<q|u|g|p|U|G|P> <filesystem>\n");
 	fprintf(stderr, "       feature [-v] -c <file>\n");
 	fprintf(stderr, "       feature [-v] -t <file>\n");
-	fprintf(stderr, "       feature -A | -o | -s | -w\n");
+	fprintf(stderr, "       feature -A | -R | -o | -s | -w\n");
 	exit(1);
 }
 
@@ -215,6 +220,29 @@ check_aio_support(void)
 #endif
 }
 
+static int
+check_uring_support(void)
+{
+#ifdef HAVE_LIBURING_H
+	struct io_uring ring;
+	int err;
+
+	err = io_uring_queue_init(1, &ring, 0);
+	if (err == 0)
+		return 0;
+
+	if (err == -ENOSYS) /* CONFIG_IO_URING=n */
+		return 1;
+
+	fprintf(stderr, "unexpected error from io_uring_queue_init(): %s\n",
+		strerror(-err));
+	return 2;
+#else
+	/* liburing is unavailable, assume IO_URING is unsupported */
+	return 1;
+#endif
+}
+
 
 int
 main(int argc, char **argv)
@@ -228,6 +256,7 @@ main(int argc, char **argv)
 	int	pflag = 0;
 	int	Pflag = 0;
 	int	qflag = 0;
+	int	Rflag = 0;
 	int	sflag = 0;
 	int	uflag = 0;
 	int	Uflag = 0;
@@ -235,7 +264,7 @@ main(int argc, char **argv)
 	int	oflag = 0;
 	char	*fs = NULL;
 
-	while ((c = getopt(argc, argv, "ActgGopPqsuUvw")) != EOF) {
+	while ((c = getopt(argc, argv, "ActgGopPqRsuUvw")) != EOF) {
 		switch (c) {
 		case 'A':
 			Aflag++;
@@ -264,6 +293,9 @@ main(int argc, char **argv)
 		case 'q':
 			qflag++;
 			break;
+		case 'R':
+			Rflag++;
+			break;
 		case 's':
 			sflag++;
 			break;
@@ -289,7 +321,7 @@ main(int argc, char **argv)
 		if (optind != argc-1)	/* need a device */
 			usage();
 		fs = argv[argc-1];
-	} else if (Aflag || wflag || sflag || oflag) {
+	} else if (Aflag || Rflag || wflag || sflag || oflag) {
 		if (optind != argc)
 			usage();
 	} else 
@@ -317,6 +349,9 @@ main(int argc, char **argv)
 	if (Aflag)
 		return(check_aio_support());
 
+	if (Rflag)
+		return(check_uring_support());
+
 	if (sflag) {
 		printf("%d\n", getpagesize());
 		exit(0);
-- 
2.20.1


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

* [PATCH 1/3] src/feature: add IO_URING feature checking
  2020-09-16 12:30 [PATCH 0/3] xfstests: new io_uring fsx test Zorro Lang
@ 2020-09-16 12:30 ` Zorro Lang
  0 siblings, 0 replies; 15+ messages in thread
From: Zorro Lang @ 2020-09-16 12:30 UTC (permalink / raw)
  To: fstests; +Cc: io-uring

IO_URING is a new feature for GNU/Linux system, if someone case of
xfstests tests this feature, better to check if current system
supports it, or need _notrun.

Signed-off-by: Zorro Lang <zlang@redhat.com>
---
 src/Makefile  |  4 ++++
 src/feature.c | 41 ++++++++++++++++++++++++++++++++++++++---
 2 files changed, 42 insertions(+), 3 deletions(-)

diff --git a/src/Makefile b/src/Makefile
index 643c1916..f1422c5c 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -65,6 +65,10 @@ SUBDIRS += aio-dio-regress
 LLDLIBS += -laio
 endif
 
+ifeq ($(HAVE_URING), true)
+LLDLIBS += -luring
+endif
+
 CFILES = $(TARGETS:=.c)
 LDIRT = $(TARGETS) fssum
 
diff --git a/src/feature.c b/src/feature.c
index a7eb7595..df550cf6 100644
--- a/src/feature.c
+++ b/src/feature.c
@@ -19,6 +19,7 @@
  *
  * Test for machine features
  *   -A  test whether AIO syscalls are available
+ *   -R  test whether IO_URING syscalls are available
  *   -o  report a number of online cpus
  *   -s  report pagesize
  *   -w  report bits per long
@@ -39,6 +40,10 @@
 #include <libaio.h>
 #endif
 
+#ifdef HAVE_LIBURING_H
+#include <liburing.h>
+#endif
+
 #ifndef USRQUOTA
 #define USRQUOTA  0
 #endif
@@ -59,7 +64,7 @@ usage(void)
 	fprintf(stderr, "Usage: feature [-v] -<q|u|g|p|U|G|P> <filesystem>\n");
 	fprintf(stderr, "       feature [-v] -c <file>\n");
 	fprintf(stderr, "       feature [-v] -t <file>\n");
-	fprintf(stderr, "       feature -A | -o | -s | -w\n");
+	fprintf(stderr, "       feature -A | -R | -o | -s | -w\n");
 	exit(1);
 }
 
@@ -215,6 +220,29 @@ check_aio_support(void)
 #endif
 }
 
+static int
+check_uring_support(void)
+{
+#ifdef HAVE_LIBURING_H
+	struct io_uring ring;
+	int err;
+
+	err = io_uring_queue_init(1, &ring, 0);
+	if (err == 0)
+		return 0;
+
+	if (err == -ENOSYS) /* CONFIG_IO_URING=n */
+		return 1;
+
+	fprintf(stderr, "unexpected error from io_uring_queue_init(): %s\n",
+		strerror(-err));
+	return 2;
+#else
+	/* liburing is unavailable, assume IO_URING is unsupported */
+	return 1;
+#endif
+}
+
 
 int
 main(int argc, char **argv)
@@ -228,6 +256,7 @@ main(int argc, char **argv)
 	int	pflag = 0;
 	int	Pflag = 0;
 	int	qflag = 0;
+	int	Rflag = 0;
 	int	sflag = 0;
 	int	uflag = 0;
 	int	Uflag = 0;
@@ -235,7 +264,7 @@ main(int argc, char **argv)
 	int	oflag = 0;
 	char	*fs = NULL;
 
-	while ((c = getopt(argc, argv, "ActgGopPqsuUvw")) != EOF) {
+	while ((c = getopt(argc, argv, "ActgGopPqRsuUvw")) != EOF) {
 		switch (c) {
 		case 'A':
 			Aflag++;
@@ -264,6 +293,9 @@ main(int argc, char **argv)
 		case 'q':
 			qflag++;
 			break;
+		case 'R':
+			Rflag++;
+			break;
 		case 's':
 			sflag++;
 			break;
@@ -289,7 +321,7 @@ main(int argc, char **argv)
 		if (optind != argc-1)	/* need a device */
 			usage();
 		fs = argv[argc-1];
-	} else if (Aflag || wflag || sflag || oflag) {
+	} else if (Aflag || Rflag || wflag || sflag || oflag) {
 		if (optind != argc)
 			usage();
 	} else 
@@ -317,6 +349,9 @@ main(int argc, char **argv)
 	if (Aflag)
 		return(check_aio_support());
 
+	if (Rflag)
+		return(check_uring_support());
+
 	if (sflag) {
 		printf("%d\n", getpagesize());
 		exit(0);
-- 
2.20.1


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

* [PATCH 1/3] src/feature: add IO_URING feature checking
  2020-09-16 12:23 [PATCH 0/3] " Zorro Lang
@ 2020-09-16 12:23 ` Zorro Lang
  0 siblings, 0 replies; 15+ messages in thread
From: Zorro Lang @ 2020-09-16 12:23 UTC (permalink / raw)
  To: fstests; +Cc: io-uring

IO_URING is a new feature for GNU/Linux system, if someone case of
xfstests tests this feature, better to check if current system
supports it, or need _notrun.

Signed-off-by: Zorro Lang <zlang@redhat.com>
---
 src/Makefile  |  4 ++++
 src/feature.c | 41 ++++++++++++++++++++++++++++++++++++++---
 2 files changed, 42 insertions(+), 3 deletions(-)

diff --git a/src/Makefile b/src/Makefile
index 643c1916..f1422c5c 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -65,6 +65,10 @@ SUBDIRS += aio-dio-regress
 LLDLIBS += -laio
 endif
 
+ifeq ($(HAVE_URING), true)
+LLDLIBS += -luring
+endif
+
 CFILES = $(TARGETS:=.c)
 LDIRT = $(TARGETS) fssum
 
diff --git a/src/feature.c b/src/feature.c
index a7eb7595..df550cf6 100644
--- a/src/feature.c
+++ b/src/feature.c
@@ -19,6 +19,7 @@
  *
  * Test for machine features
  *   -A  test whether AIO syscalls are available
+ *   -R  test whether IO_URING syscalls are available
  *   -o  report a number of online cpus
  *   -s  report pagesize
  *   -w  report bits per long
@@ -39,6 +40,10 @@
 #include <libaio.h>
 #endif
 
+#ifdef HAVE_LIBURING_H
+#include <liburing.h>
+#endif
+
 #ifndef USRQUOTA
 #define USRQUOTA  0
 #endif
@@ -59,7 +64,7 @@ usage(void)
 	fprintf(stderr, "Usage: feature [-v] -<q|u|g|p|U|G|P> <filesystem>\n");
 	fprintf(stderr, "       feature [-v] -c <file>\n");
 	fprintf(stderr, "       feature [-v] -t <file>\n");
-	fprintf(stderr, "       feature -A | -o | -s | -w\n");
+	fprintf(stderr, "       feature -A | -R | -o | -s | -w\n");
 	exit(1);
 }
 
@@ -215,6 +220,29 @@ check_aio_support(void)
 #endif
 }
 
+static int
+check_uring_support(void)
+{
+#ifdef HAVE_LIBURING_H
+	struct io_uring ring;
+	int err;
+
+	err = io_uring_queue_init(1, &ring, 0);
+	if (err == 0)
+		return 0;
+
+	if (err == -ENOSYS) /* CONFIG_IO_URING=n */
+		return 1;
+
+	fprintf(stderr, "unexpected error from io_uring_queue_init(): %s\n",
+		strerror(-err));
+	return 2;
+#else
+	/* liburing is unavailable, assume IO_URING is unsupported */
+	return 1;
+#endif
+}
+
 
 int
 main(int argc, char **argv)
@@ -228,6 +256,7 @@ main(int argc, char **argv)
 	int	pflag = 0;
 	int	Pflag = 0;
 	int	qflag = 0;
+	int	Rflag = 0;
 	int	sflag = 0;
 	int	uflag = 0;
 	int	Uflag = 0;
@@ -235,7 +264,7 @@ main(int argc, char **argv)
 	int	oflag = 0;
 	char	*fs = NULL;
 
-	while ((c = getopt(argc, argv, "ActgGopPqsuUvw")) != EOF) {
+	while ((c = getopt(argc, argv, "ActgGopPqRsuUvw")) != EOF) {
 		switch (c) {
 		case 'A':
 			Aflag++;
@@ -264,6 +293,9 @@ main(int argc, char **argv)
 		case 'q':
 			qflag++;
 			break;
+		case 'R':
+			Rflag++;
+			break;
 		case 's':
 			sflag++;
 			break;
@@ -289,7 +321,7 @@ main(int argc, char **argv)
 		if (optind != argc-1)	/* need a device */
 			usage();
 		fs = argv[argc-1];
-	} else if (Aflag || wflag || sflag || oflag) {
+	} else if (Aflag || Rflag || wflag || sflag || oflag) {
 		if (optind != argc)
 			usage();
 	} else 
@@ -317,6 +349,9 @@ main(int argc, char **argv)
 	if (Aflag)
 		return(check_aio_support());
 
+	if (Rflag)
+		return(check_uring_support());
+
 	if (sflag) {
 		printf("%d\n", getpagesize());
 		exit(0);
-- 
2.20.1


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

end of thread, other threads:[~2020-11-08 12:26 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-16 17:14 [PATCH 0/3] xfstests: add IO_URING test cases Zorro Lang
2020-09-16 17:14 ` [PATCH 1/3] src/feature: add IO_URING feature checking Zorro Lang
2020-10-02 18:19   ` Brian Foster
2020-09-16 17:14 ` [PATCH 2/3] generic: fsx IO_URING soak tests Zorro Lang
2020-10-02 18:20   ` Brian Foster
2020-09-16 17:14 ` [PATCH 3/3] generic: IO_URING direct IO fsx test Zorro Lang
2020-10-02 18:20   ` Brian Foster
2020-10-11 12:15     ` Zorro Lang
2020-10-12 17:55       ` Brian Foster
2020-10-05 16:45   ` Darrick J. Wong
2020-10-11 12:36     ` Zorro Lang
  -- strict thread matches above, loose matches on Subject: below --
2020-11-08 12:26 [PATCH 0/3] xfstests: fsx IO_URING test cases Zorro Lang
2020-11-08 12:26 ` [PATCH 1/3] src/feature: add IO_URING feature checking Zorro Lang
2020-09-16 13:11 [PATCH 0/3] xfstests: new io_uring fsx test Zorro Lang
2020-09-16 13:11 ` [PATCH 1/3] src/feature: add IO_URING feature checking Zorro Lang
2020-09-16 12:30 [PATCH 0/3] xfstests: new io_uring fsx test Zorro Lang
2020-09-16 12:30 ` [PATCH 1/3] src/feature: add IO_URING feature checking Zorro Lang
2020-09-16 12:23 [PATCH 0/3] " Zorro Lang
2020-09-16 12:23 ` [PATCH 1/3] " Zorro Lang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).