fio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] *** Two small patches for xnvme I/O engine ***
       [not found] <CGME20220816054808epcas5p2295e7b76603cdd2183f9e2c2698cd90a@epcas5p2.samsung.com>
@ 2022-08-16  5:38 ` Ankit Kumar
       [not found]   ` <CGME20220816054809epcas5p1ef377b2a3e72983f569c967c8768ee43@epcas5p1.samsung.com>
                     ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Ankit Kumar @ 2022-08-16  5:38 UTC (permalink / raw)
  To: axboe; +Cc: vincent.fu, fio, Ankit Kumar

Fix segmentation fault issue if thread=1 is not specified.
Update the fio documentation.

Ankit Kumar (2):
  engines/xnvme: fix segfault issue with xnvme ioengine
  doc: update fio doc for xnvme engine

 HOWTO.rst       | 37 ++++++++++++++++++++++++++-----------
 engines/xnvme.c | 17 ++++++++++++++---
 fio.1           | 34 +++++++++++++++++++++-------------
 3 files changed, 61 insertions(+), 27 deletions(-)

-- 
2.17.1


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

* [PATCH 1/2] engines/xnvme: fix segfault issue with xnvme ioengine
       [not found]   ` <CGME20220816054809epcas5p1ef377b2a3e72983f569c967c8768ee43@epcas5p1.samsung.com>
@ 2022-08-16  5:38     ` Ankit Kumar
  0 siblings, 0 replies; 4+ messages in thread
From: Ankit Kumar @ 2022-08-16  5:38 UTC (permalink / raw)
  To: axboe; +Cc: vincent.fu, fio, Ankit Kumar

fix segfault when xnvme ioengine is called without thread=1.
The segfault happens because td->io_ops_data is accessed at
two locations xnvme_fioe_cleanup and xnvme_fioe_iomem_free,
during the error handling call.

Signed-off-by: Ankit Kumar <ankit.kumar@samsung.com>
---
 engines/xnvme.c | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/engines/xnvme.c b/engines/xnvme.c
index c11b33a8..d8647481 100644
--- a/engines/xnvme.c
+++ b/engines/xnvme.c
@@ -205,9 +205,14 @@ static void _dev_close(struct thread_data *td, struct xnvme_fioe_fwrap *fwrap)
 
 static void xnvme_fioe_cleanup(struct thread_data *td)
 {
-	struct xnvme_fioe_data *xd = td->io_ops_data;
+	struct xnvme_fioe_data *xd = NULL;
 	int err;
 
+	if (!td->io_ops_data)
+		return;
+
+	xd = td->io_ops_data;
+
 	err = pthread_mutex_lock(&g_serialize);
 	if (err)
 		log_err("ioeng->cleanup(): pthread_mutex_lock(), err(%d)\n", err);
@@ -367,8 +372,14 @@ static int xnvme_fioe_iomem_alloc(struct thread_data *td, size_t total_mem)
 /* NOTE: using the first device for buffer-allocators) */
 static void xnvme_fioe_iomem_free(struct thread_data *td)
 {
-	struct xnvme_fioe_data *xd = td->io_ops_data;
-	struct xnvme_fioe_fwrap *fwrap = &xd->files[0];
+	struct xnvme_fioe_data *xd = NULL;
+	struct xnvme_fioe_fwrap *fwrap = NULL;
+
+	if (!td->io_ops_data)
+		return;
+
+	xd = td->io_ops_data;
+	fwrap = &xd->files[0];
 
 	if (!fwrap->dev) {
 		log_err("ioeng->iomem_free(): failed no dev-handle\n");
-- 
2.17.1


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

* [PATCH 2/2] doc: update fio doc for xnvme engine
       [not found]   ` <CGME20220816054810epcas5p4bc47353694128a80ad48fbcc89fb1907@epcas5p4.samsung.com>
@ 2022-08-16  5:38     ` Ankit Kumar
  0 siblings, 0 replies; 4+ messages in thread
From: Ankit Kumar @ 2022-08-16  5:38 UTC (permalink / raw)
  To: axboe; +Cc: vincent.fu, fio, Ankit Kumar

- Elaborate about the various sync, async and admin
  interfaces.
- add missing io_uring_cmd async backend entry.
- xnvme ioengine doesn't support file stat.

Signed-off-by: Ankit Kumar <ankit.kumar@samsung.com>
---
 HOWTO.rst | 37 ++++++++++++++++++++++++++-----------
 fio.1     | 34 +++++++++++++++++++++-------------
 2 files changed, 47 insertions(+), 24 deletions(-)

diff --git a/HOWTO.rst b/HOWTO.rst
index 05fc117f..b2750b56 100644
--- a/HOWTO.rst
+++ b/HOWTO.rst
@@ -2780,41 +2780,56 @@ with the caveat that when used on the command line, they must come after the
 	Select the xnvme async command interface. This can take these values.
 
 	**emu**
-		This is default and used to emulate asynchronous I/O.
+		This is default and use to emulate asynchronous I/O by using a
+		single thread to create a queue pair on top of a synchronous
+		I/O interface using the NVMe driver IOCTL.
 	**thrpool**
-		Use thread pool for Asynchronous I/O.
+		Emulate an asynchronous I/O interface with a pool of userspace
+		threads on top of a synchronous I/O interface using the NVMe
+		driver IOCTL. By default four threads are used.
 	**io_uring**
-		Use Linux io_uring/liburing for Asynchronous I/O.
+		Linux native asynchronous I/O interface which supports both
+		direct and buffered I/O.
+	**io_uring_cmd**
+		Fast Linux native asynchronous I/O interface for NVMe pass
+		through commands. This only works with NVMe character device
+		(/dev/ngXnY).
 	**libaio**
 		Use Linux aio for Asynchronous I/O.
 	**posix**
-		Use POSIX aio for Asynchronous I/O.
+		Use the posix asynchronous I/O interface to perform one or
+		more I/O operations asynchronously.
 	**nil**
-		Use nil-io; For introspective perf. evaluation
+		Do not transfer any data; just pretend to. This is mainly used
+		for introspective performance evaluation.
 
 .. option:: xnvme_sync=str : [xnvme]
 
 	Select the xnvme synchronous command interface. This can take these values.
 
 	**nvme**
-		This is default and uses Linux NVMe Driver ioctl() for synchronous I/O.
+		This is default and uses Linux NVMe Driver ioctl() for
+		synchronous I/O.
 	**psync**
-		Use pread()/write() for synchronous I/O.
+		This supports regular as well as vectored pread() and pwrite()
+		commands.
+	**block**
+		This is the same as psync except that it also supports zone
+		management commands using Linux block layer IOCTLs.
 
 .. option:: xnvme_admin=str : [xnvme]
 
 	Select the xnvme admin command interface. This can take these values.
 
 	**nvme**
-		This is default and uses linux NVMe Driver ioctl() for admin commands.
+		This is default and uses linux NVMe Driver ioctl() for admin
+		commands.
 	**block**
 		Use Linux Block Layer ioctl() and sysfs for admin commands.
-	**file_as_ns**
-		Use file-stat to construct NVMe idfy responses.
 
 .. option:: xnvme_dev_nsid=int : [xnvme]
 
-	xnvme namespace identifier, for userspace NVMe driver.
+	xnvme namespace identifier for userspace NVMe driver, such as SPDK.
 
 .. option:: xnvme_iovec=int : [xnvme]
 
diff --git a/fio.1 b/fio.1
index 6630525f..f3f3dc5d 100644
--- a/fio.1
+++ b/fio.1
@@ -2530,22 +2530,29 @@ Select the xnvme async command interface. This can take these values.
 .RS
 .TP
 .B emu
-This is default and used to emulate asynchronous I/O
+This is default and use to emulate asynchronous I/O by using a single thread to
+create a queue pair on top of a synchronous I/O interface using the NVMe driver
+IOCTL.
 .TP
 .BI thrpool
-Use thread pool for Asynchronous I/O
+Emulate an asynchronous I/O interface with a pool of userspace threads on top
+of a synchronous I/O interface using the NVMe driver IOCTL. By default four
+threads are used.
 .TP
 .BI io_uring
-Use Linux io_uring/liburing for Asynchronous I/O
+Linux native asynchronous I/O interface which supports both direct and buffered
+I/O.
 .TP
 .BI libaio
 Use Linux aio for Asynchronous I/O
 .TP
 .BI posix
-Use POSIX aio for Asynchronous I/O
+Use the posix asynchronous I/O interface to perform one or more I/O operations
+asynchronously.
 .TP
 .BI nil
-Use nil-io; For introspective perf. evaluation
+Do not transfer any data; just pretend to. This is mainly used for
+introspective performance evaluation.
 .RE
 .RE
 .TP
@@ -2555,10 +2562,14 @@ Select the xnvme synchronous command interface. This can take these values.
 .RS
 .TP
 .B nvme
-This is default and uses Linux NVMe Driver ioctl() for synchronous I/O
+This is default and uses Linux NVMe Driver ioctl() for synchronous I/O.
 .TP
 .BI psync
-Use pread()/write() for synchronous I/O
+This supports regular as well as vectored pread() and pwrite() commands.
+.TP
+.BI block
+This is the same as psync except that it also supports zone management
+commands using Linux block layer IOCTLs.
 .RE
 .RE
 .TP
@@ -2568,18 +2579,15 @@ Select the xnvme admin command interface. This can take these values.
 .RS
 .TP
 .B nvme
-This is default and uses Linux NVMe Driver ioctl() for admin commands
+This is default and uses Linux NVMe Driver ioctl() for admin commands.
 .TP
 .BI block
-Use Linux Block Layer ioctl() and sysfs for admin commands
-.TP
-.BI file_as_ns
-Use file-stat as to construct NVMe idfy responses
+Use Linux Block Layer ioctl() and sysfs for admin commands.
 .RE
 .RE
 .TP
 .BI (xnvme)xnvme_dev_nsid\fR=\fPint
-xnvme namespace identifier, for userspace NVMe driver.
+xnvme namespace identifier for userspace NVMe driver such as SPDK.
 .TP
 .BI (xnvme)xnvme_iovec
 If this option is set, xnvme will use vectored read/write commands.
-- 
2.17.1


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

* Re: [PATCH 0/2] *** Two small patches for xnvme I/O engine ***
  2022-08-16  5:38 ` [PATCH 0/2] *** Two small patches for xnvme I/O engine *** Ankit Kumar
       [not found]   ` <CGME20220816054809epcas5p1ef377b2a3e72983f569c967c8768ee43@epcas5p1.samsung.com>
       [not found]   ` <CGME20220816054810epcas5p4bc47353694128a80ad48fbcc89fb1907@epcas5p4.samsung.com>
@ 2022-08-16 12:18   ` Jens Axboe
  2 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2022-08-16 12:18 UTC (permalink / raw)
  To: ankit.kumar; +Cc: fio, vincent.fu

On Tue, 16 Aug 2022 11:08:19 +0530, Ankit Kumar wrote:
> Fix segmentation fault issue if thread=1 is not specified.
> Update the fio documentation.
> 
> Ankit Kumar (2):
>   engines/xnvme: fix segfault issue with xnvme ioengine
>   doc: update fio doc for xnvme engine
> 
> [...]

Applied, thanks!

[1/2] engines/xnvme: fix segfault issue with xnvme ioengine
      commit: fdac9c68425a7bd4008614476a27e536b0b0bf8b
[2/2] doc: update fio doc for xnvme engine
      commit: 4deb92f9e1a83682143661eb3b04422bdfff5ace

Best regards,
-- 
Jens Axboe



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

end of thread, other threads:[~2022-08-16 12:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20220816054808epcas5p2295e7b76603cdd2183f9e2c2698cd90a@epcas5p2.samsung.com>
2022-08-16  5:38 ` [PATCH 0/2] *** Two small patches for xnvme I/O engine *** Ankit Kumar
     [not found]   ` <CGME20220816054809epcas5p1ef377b2a3e72983f569c967c8768ee43@epcas5p1.samsung.com>
2022-08-16  5:38     ` [PATCH 1/2] engines/xnvme: fix segfault issue with xnvme ioengine Ankit Kumar
     [not found]   ` <CGME20220816054810epcas5p4bc47353694128a80ad48fbcc89fb1907@epcas5p4.samsung.com>
2022-08-16  5:38     ` [PATCH 2/2] doc: update fio doc for xnvme engine Ankit Kumar
2022-08-16 12:18   ` [PATCH 0/2] *** Two small patches for xnvme I/O engine *** Jens Axboe

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).