diff mbox series

[1/6] common/fio: add helpers using io-uring cmd engine

Message ID 20221221103441.3216600-2-mcgrof@kernel.org (mailing list archive)
State New, archived
Headers show
Series blktests: char device tests with iouring-cmd fio | expand

Commit Message

Luis Chamberlain Dec. 21, 2022, 10:34 a.m. UTC
This will allow us to add tests which use the io-uring cmd engine,
part of fio. They are inspired by the work by Anuj Gupta and
Ankit Kumar which added sample fio files onto fio for this exact
purpose.

We can build on those to expand test coverage with elaborate tests.

We don't specify the cmd to allow other types of io-uring cmd
users to use this other than nvme.

Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
---
 common/fio | 47 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)

Comments

Joel Granados Dec. 30, 2022, 10:10 a.m. UTC | #1
On Wed, Dec 21, 2022 at 02:34:36AM -0800, Luis Chamberlain wrote:
> This will allow us to add tests which use the io-uring cmd engine,
> part of fio. They are inspired by the work by Anuj Gupta and
> Ankit Kumar which added sample fio files onto fio for this exact
> purpose.
> 
> We can build on those to expand test coverage with elaborate tests.
> 
> We don't specify the cmd to allow other types of io-uring cmd
> users to use this other than nvme.
> 
> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
> ---
>  common/fio | 47 +++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 47 insertions(+)
> 
> diff --git a/common/fio b/common/fio
> index bed76d555b2a..4da90804ed21 100644
> --- a/common/fio
> +++ b/common/fio
> @@ -184,6 +184,53 @@ _run_fio_verify_io() {
>  	rm -f local*verify*state
>  }
>  
> +_run_fio_rand_iouring_cmd() {
> +	_run_fio --bs=4k --rw=randread --numjobs="$(nproc)" \
> +		--ioengine=io_uring_cmd --iodepth=32 \
> +		--thread=1 --stonewall=1 \
> +		--name=reads "$@"
> +}
> +
> +_run_fio_verify_iouring_cmd_randwrite() {
> +	_run_fio --bs=4k --rw=randwrite --numjobs="$(nproc)" \
> +		--ioengine=io_uring_cmd --iodepth=32 \
> +		--thread=1 --stonewall=1 \
> +		--sqthread_poll=1 --sqthread_poll_cpu=0 \
> +		--nonvectored=1 --registerfiles=1 \
> +		--verify=crc32c \
> +		--name=verify "$@"
> +	rm -f local*verify*state
> +}
> +
> +_run_fio_verify_iouring_cmd_write_opts() {
> +	_run_fio --bs=4k --rw=write --numjobs="$(nproc)" \
> +		--ioengine=io_uring_cmd --iodepth=32 \
> +		--thread=1 --stonewall=1 \
> +		--sqthread_poll=1 --sqthread_poll_cpu=0 \
> +		--nonvectored=1 --registerfiles=1 \
> +		--verify=crc32c \
> +		--name=verify "$@"
> +	rm -f local*verify*state
> +}
> +
> +_run_fio_iouring_cmd_zone() {
> +	_run_fio --rw=randread --numjobs="$(nproc)" \
> +		--ioengine=io_uring_cmd --iodepth=1 \
> +		--stonewall=1 \
> +		--zonemode=zbd \
> +		--name=reads "$@"
> +}
> +
> +_run_fio_verify_iouring_cmd_write_opts_zone() {
> +	_run_fio --rw=randread --numjobs="$(nproc)" \
> +		--ioengine=io_uring_cmd --iodepth=1 \
> +		--stonewall=1 \
> +		--zonemode=zbd \
> +		--sqthread_poll=1 --registerfiles=1 --sqthread_poll_cpu=0 \
> +		--verify=crc32c \
> +		--name=verify "$@"
Are you missing a "rm -f local*verify*state" here?

Joel
> +}
> +
>  _fio_perf_report() {
>  	# If there is more than one group, we don't know what to report.
>  	if [[ $(wc -l < "$TMPDIR/fio_perf") -gt 1 ]]; then
> -- 
> 2.35.1
>
diff mbox series

Patch

diff --git a/common/fio b/common/fio
index bed76d555b2a..4da90804ed21 100644
--- a/common/fio
+++ b/common/fio
@@ -184,6 +184,53 @@  _run_fio_verify_io() {
 	rm -f local*verify*state
 }
 
+_run_fio_rand_iouring_cmd() {
+	_run_fio --bs=4k --rw=randread --numjobs="$(nproc)" \
+		--ioengine=io_uring_cmd --iodepth=32 \
+		--thread=1 --stonewall=1 \
+		--name=reads "$@"
+}
+
+_run_fio_verify_iouring_cmd_randwrite() {
+	_run_fio --bs=4k --rw=randwrite --numjobs="$(nproc)" \
+		--ioengine=io_uring_cmd --iodepth=32 \
+		--thread=1 --stonewall=1 \
+		--sqthread_poll=1 --sqthread_poll_cpu=0 \
+		--nonvectored=1 --registerfiles=1 \
+		--verify=crc32c \
+		--name=verify "$@"
+	rm -f local*verify*state
+}
+
+_run_fio_verify_iouring_cmd_write_opts() {
+	_run_fio --bs=4k --rw=write --numjobs="$(nproc)" \
+		--ioengine=io_uring_cmd --iodepth=32 \
+		--thread=1 --stonewall=1 \
+		--sqthread_poll=1 --sqthread_poll_cpu=0 \
+		--nonvectored=1 --registerfiles=1 \
+		--verify=crc32c \
+		--name=verify "$@"
+	rm -f local*verify*state
+}
+
+_run_fio_iouring_cmd_zone() {
+	_run_fio --rw=randread --numjobs="$(nproc)" \
+		--ioengine=io_uring_cmd --iodepth=1 \
+		--stonewall=1 \
+		--zonemode=zbd \
+		--name=reads "$@"
+}
+
+_run_fio_verify_iouring_cmd_write_opts_zone() {
+	_run_fio --rw=randread --numjobs="$(nproc)" \
+		--ioengine=io_uring_cmd --iodepth=1 \
+		--stonewall=1 \
+		--zonemode=zbd \
+		--sqthread_poll=1 --registerfiles=1 --sqthread_poll_cpu=0 \
+		--verify=crc32c \
+		--name=verify "$@"
+}
+
 _fio_perf_report() {
 	# If there is more than one group, we don't know what to report.
 	if [[ $(wc -l < "$TMPDIR/fio_perf") -gt 1 ]]; then