All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vincent Fu <vincent.fu@samsung.com>
To: Ankit Kumar <ankit.kumar@samsung.com>,
	"axboe@kernel.dk" <axboe@kernel.dk>
Cc: "fio@vger.kernel.org" <fio@vger.kernel.org>,
	"krish.reddy@samsung.com" <krish.reddy@samsung.com>,
	"simon.lund@samsung.com" <simon.lund@samsung.com>
Subject: RE: [PATCH 1/3] engines/xnvme: add xnvme engine
Date: Fri, 6 May 2022 16:55:31 +0000	[thread overview]
Message-ID: <c57c33726a334fb5a49100f40fcce016@samsung.com> (raw)
In-Reply-To: <20220505131935.32076-2-ankit.kumar@samsung.com>

> -----Original Message-----
> From: Ankit Kumar [mailto:ankit.kumar@samsung.com]
> Sent: Thursday, May 5, 2022 9:20 AM
> To: axboe@kernel.dk
> Cc: fio@vger.kernel.org; krish.reddy@samsung.com;
> simon.lund@samsung.com; Ankit Kumar <ankit.kumar@samsung.com>
> Subject: [PATCH 1/3] engines/xnvme: add xnvme engine
> 
> This patch introduces a new fio engine to work with xNVMe >= 0.2.0.
> xNVMe provides a user space library (libxnvme) to work with NVMe
> devices. The NVMe driver being used by libxnvme is re-targetable and
> can be any one of the GNU/Linux Kernel NVMe driver via libaio,
> IOCTLs, io_uring, the SPDK NVMe driver, or your own custom NVMe
> driver.
> 
> For more info visit
> https://urldefense.com/v3/__https://protect2.fireeye.com/v1/url?k=ad
> 739a68-ccf88f52-ad721127-74fe4860008a-
> e490d5c8a92d072c&q=1&e=07140046-8b99-485a-a6cf-
> 0c1685707a67&u=https*3A*2F*2Fxnvme.io*2F__;JSUlJQ!!EwVzqGoTKB
> qv-
> 0DWAJBm!ChkUAg8V4FGdLAgw54MUDD8PRpVmo1RBeReZpfMKxWz8a
> DMsUtG1GYPPc9rhJot4-Vw9$
> https://urldefense.com/v3/__https://protect2.fireeye.com/v1/url?k=4f
> 9d8ae4-2e169fde-4f9c01ab-74fe4860008a-
> b5cd486f43ed047d&q=1&e=07140046-8b99-485a-a6cf-
> 0c1685707a67&u=https*3A*2F*2Fgithub.com*2FOpenMPDK*2FxNVMe
> __;JSUlJSU!!EwVzqGoTKBqv-
> 0DWAJBm!ChkUAg8V4FGdLAgw54MUDD8PRpVmo1RBeReZpfMKxWz8a
> DMsUtG1GYPPc9rhJqXGQ87L$
> 
> Co-Authored-By: Ankit Kumar <ankit.kumar@samsung.com>
> Co-Authored-By: Simon A. F. Lund <simon.lund@samsung.com>
> Co-Authored-By: Mads Ynddal <m.ynddal@samsung.com>
> Co-Authored-By: Michael Bang <mi.bang@samsung.com>
> Co-Authored-By: Karl Bonde Torp <k.torp@samsung.com>
> Co-Authored-By: Gurmeet Singh <gur.singh@samsung.com>
> Co-Authored-By: Pierre Labat <plabat@micron.com>
> ---

<snip>

Do we need an SPDX license identifier at the top of xnvme.c?

> +++ b/engines/xnvme.c
> @@ -0,0 +1,1000 @@
> +/*
> + * fio xNVMe IO Engine
> + *
> + * IO engine using the xNVMe C API.
> + *

<snip>

> +static void xnvme_fioe_cleanup(struct thread_data *td)
> +{
> +	struct xnvme_fioe_data *xd = td->io_ops_data;
> +	int err;
> +
> +	err = pthread_mutex_lock(&g_serialize);
> +	if (err)
> +		XNVME_DEBUG("FAILED: pthread_mutex_lock(),
> err: %d", err);
> +		/* NOTE: not returning here */
> +
> +	for (uint64_t i = 0; i < xd->nallocated; ++i) {
> +		int err;
> +
> +		err = _dev_close(td, &xd->files[i]);
> +		if (err)
> +			XNVME_DEBUG("xnvme_fioe: cleanup():
> Unexpected error");
> +	}
> +	err = pthread_mutex_unlock(&g_serialize);
> +	if (err)
> +		XNVME_DEBUG("FAILED: pthread_mutex_unlock(),
> err: %d", err);
> +
> +	free(xd->iocq);
> +	free(xd->iovec);
> +	free(xd);
> +	td->io_ops_data = NULL;
> +}

If we fail to acquire the lock above we should not try to unlock it. Also, we
declare err a second time inside the for loop.

With the minor issues addressed:

Reviewed-by: Vincent Fu <vincent.fu@samsung.com>

  reply	other threads:[~2022-05-06 16:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20220505132529epcas5p25512da35ba70c4eed9890f299b1db12f@epcas5p2.samsung.com>
2022-05-05 13:19 ` [PATCH 0/3] fio: add xnvme engine Ankit Kumar
     [not found]   ` <CGME20220505132539epcas5p41f26baadd8e697ae00f637a29f7544a1@epcas5p4.samsung.com>
2022-05-05 13:19     ` [PATCH 1/3] engines/xnvme: " Ankit Kumar
2022-05-06 16:55       ` Vincent Fu [this message]
     [not found]   ` <CGME20220505132543epcas5p21198504e47717ff87ec88a1771a6c63d@epcas5p2.samsung.com>
2022-05-05 13:19     ` [PATCH 2/3] docs: documentation for xnvme ioengine Ankit Kumar
2022-05-06 15:57       ` Vincent Fu
     [not found]   ` <CGME20220505132546epcas5p331f666cadd5c7e788d27d09b144e0b8a@epcas5p3.samsung.com>
2022-05-05 13:19     ` [PATCH 3/3] examples: add example job file for xnvme engine usage Ankit Kumar
2022-05-06 16:00       ` Vincent Fu
2022-05-11 16:30 [PATCH v2 0/3] fio: add xnvme engine Ankit Kumar
     [not found] ` <CGME20220511163555epcas5p11802150a9855558ab5823252f86dead3@epcas5p1.samsung.com>
2022-05-11 16:30   ` [PATCH 1/3] engines/xnvme: " Ankit Kumar

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=c57c33726a334fb5a49100f40fcce016@samsung.com \
    --to=vincent.fu@samsung.com \
    --cc=ankit.kumar@samsung.com \
    --cc=axboe@kernel.dk \
    --cc=fio@vger.kernel.org \
    --cc=krish.reddy@samsung.com \
    --cc=simon.lund@samsung.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.