From: Vincent Fu <vincentfu@gmail.com>
To: Alberto Faria <afaria@redhat.com>, fio@vger.kernel.org
Cc: Kevin Wolf <kwolf@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
Stefano Garzarella <sgarzare@redhat.com>
Subject: Re: [PATCH 08/10] engines/libblkio: Add option libblkio_force_enable_completion_eventfd
Date: Thu, 1 Dec 2022 12:23:11 -0500 [thread overview]
Message-ID: <1c23ed4a-b907-242c-62ef-20b4b4c2d271@gmail.com> (raw)
In-Reply-To: <20221121182902.373491-9-afaria@redhat.com>
On 11/21/22 13:29, Alberto Faria wrote:
> When set, the queue's completion fd is enabled even when it isn't used,
> i.e., even if option libblkio_wait_mode is _not_ set to "eventfd".
>
> Depending on the libblkio driver, this can have an impact on
> performance. This option allows evaluating that overhead.
>
> Signed-off-by: Alberto Faria <afaria@redhat.com>
> ---
> HOWTO.rst | 9 ++++++++-
> engines/libblkio.c | 21 +++++++++++++++++++--
> fio.1 | 10 +++++++++-
> 3 files changed, 36 insertions(+), 4 deletions(-)
>
> diff --git a/HOWTO.rst b/HOWTO.rst
> index 4b059cb2..7b3a3ffc 100644
> --- a/HOWTO.rst
> +++ b/HOWTO.rst
> @@ -2333,7 +2333,8 @@ with the caveat that when used on the command line, they must come after the
> [libblkio]
>
> Use poll queues. This is incompatible with
> - :option:`libblkio_wait_mode=eventfd <libblkio_wait_mode>`.
> + :option:`libblkio_wait_mode=eventfd <libblkio_wait_mode>` and
> + :option:`libblkio_force_enable_completion_eventfd`.
>
> [pvsync2]
>
> @@ -2896,6 +2897,12 @@ with the caveat that when used on the command line, they must come after the
> **loop**
> Use a busy loop with a non-blocking call to ``blkioq_do_io()``.
>
> +.. option:: libblkio_force_enable_completion_eventfd=bool : [libblkio]
Same comment as for previous patches regarding option types.
> +
> + Enable the ``struct blkioq``'s completion eventfd even when unused. This
> + may impact performance. The default is to enable it only if
> + :option:`libblkio_wait_mode` is **eventfd**.
> +
> I/O depth
> ~~~~~~~~~
>
> diff --git a/engines/libblkio.c b/engines/libblkio.c
> index d7666f69..3ff87e6d 100644
> --- a/engines/libblkio.c
> +++ b/engines/libblkio.c
> @@ -37,6 +37,7 @@ struct fio_blkio_options {
> unsigned int vectored;
> unsigned int write_zeroes_on_trim;
> enum fio_blkio_wait_mode wait_mode;
> + unsigned int force_enable_completion_eventfd;
> };
>
> static struct fio_option options[] = {
> @@ -120,6 +121,16 @@ static struct fio_option options[] = {
> .category = FIO_OPT_C_ENGINE,
> .group = FIO_OPT_G_LIBBLKIO,
> },
> + {
> + .name = "libblkio_force_enable_completion_eventfd",
> + .lname = "Force enable the completion eventfd, even if unused",
> + .type = FIO_OPT_STR_SET,
> + .off1 = offsetof(struct fio_blkio_options,
> + force_enable_completion_eventfd),
> + .help = "This can impact performance",
> + .category = FIO_OPT_C_ENGINE,
> + .group = FIO_OPT_G_LIBBLKIO,
> + },
>
> {
> .name = NULL,
> @@ -283,6 +294,11 @@ static int fio_blkio_setup(struct thread_data *td)
> return 1;
> }
>
> + if (options->hipri && options->force_enable_completion_eventfd) {
> + log_err("fio: option hipri is incompatible with option libblkio_force_enable_completion_eventfd\n");
> + return 1;
> + }
> +
> /* get target size */
>
> if (fio_blkio_create_and_connect(td, &b) != 0)
> @@ -308,7 +324,7 @@ out_blkio_destroy:
> struct fio_blkio_data {
> struct blkio *b;
> struct blkioq *q;
> - int completion_fd; /* -1 if not FIO_BLKIO_WAIT_MODE_EVENTFD */
> + int completion_fd; /* may be -1 if not FIO_BLKIO_WAIT_MODE_EVENTFD */
>
> bool has_mem_region; /* whether mem_region is valid */
> struct blkio_mem_region mem_region; /* only if allocated by libblkio */
> @@ -368,7 +384,8 @@ static int fio_blkio_init(struct thread_data *td)
>
> /* enable completion fd and make it blocking */
>
> - if (options->wait_mode == FIO_BLKIO_WAIT_MODE_EVENTFD) {
> + if (options->wait_mode == FIO_BLKIO_WAIT_MODE_EVENTFD ||
> + options->force_enable_completion_eventfd) {
> blkioq_set_completion_fd_enabled(data->q, true);
>
> data->completion_fd = blkioq_get_completion_fd(data->q);
> diff --git a/fio.1 b/fio.1
> index 88bb232f..e2f92bd1 100644
> --- a/fio.1
> +++ b/fio.1
> @@ -2622,7 +2622,8 @@ before starting the \fBstruct blkio\fR. Each property must have the format
> the engine sets any other properties, so those can be overriden.
> .TP
> .BI (libblkio)hipri \fR=\fPbool
> -Use poll queues. This is incompatible with \fBlibblkio_wait_mode=eventfd\fR.
> +Use poll queues. This is incompatible with \fBlibblkio_wait_mode=eventfd\fR and
> +\fBlibblkio_force_enable_completion_eventfd\fR.
> .TP
> .BI (libblkio)libblkio_vectored \fR=\fPbool
> Submit vectored read and write requests. Default is 0.
> @@ -2644,6 +2645,13 @@ Use a blocking call to \fBread()\fR on the completion eventfd.
> .TP
> .B loop
> Use a busy loop with a non-blocking call to \fBblkioq_do_io()\fR.
> +.RE
> +.RE
> +.TP
> +.BI (libblkio)libblkio_force_enable_completion_eventfd \fR=\fPbool
> +Enable the \fBstruct blkioq\fR's completion eventfd even when unused. This may
> +impact performance. The default is to enable it only if \fBlibblkio_wait_mode\fR
> +is \fBeventfd\fR.
> .SS "I/O depth"
> .TP
> .BI iodepth \fR=\fPint
next prev parent reply other threads:[~2022-12-01 17:23 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-21 18:28 [PATCH 00/10] Add a libblkio engine Alberto Faria
2022-11-21 18:28 ` [PATCH 01/10] " Alberto Faria
2022-11-22 9:17 ` Damien Le Moal
2022-12-01 22:10 ` Alberto Faria
2022-11-21 18:28 ` [PATCH 02/10] Add engine flag FIO_SKIPPABLE_IOMEM_ALLOC Alberto Faria
2022-11-21 18:28 ` [PATCH 03/10] engines/libblkio: Allow setting option mem/iomem Alberto Faria
2022-11-21 18:28 ` [PATCH 04/10] engines/libblkio: Add support for poll queues Alberto Faria
2022-12-01 17:01 ` Vincent Fu
2022-11-21 18:28 ` [PATCH 05/10] engines/libblkio: Add option libblkio_vectored Alberto Faria
2022-12-01 17:11 ` Vincent Fu
2022-12-01 22:13 ` Alberto Faria
2022-11-21 18:28 ` [PATCH 06/10] engines/libblkio: Add option libblkio_write_zeroes_on_trim Alberto Faria
2022-12-01 17:13 ` Vincent Fu
2022-11-21 18:28 ` [PATCH 07/10] engines/libblkio: Add option libblkio_wait_mode Alberto Faria
2022-12-01 17:21 ` Vincent Fu
2022-11-21 18:29 ` [PATCH 08/10] engines/libblkio: Add option libblkio_force_enable_completion_eventfd Alberto Faria
2022-12-01 17:23 ` Vincent Fu [this message]
2022-11-21 18:29 ` [PATCH 09/10] engines/libblkio: Add options for some driver-specific properties Alberto Faria
2022-11-21 18:29 ` [PATCH 10/10] engines/libblkio: Share a single blkio instance among threads in same process Alberto Faria
2022-12-01 17:29 ` Vincent Fu
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=1c23ed4a-b907-242c-62ef-20b4b4c2d271@gmail.com \
--to=vincentfu@gmail.com \
--cc=afaria@redhat.com \
--cc=fio@vger.kernel.org \
--cc=kwolf@redhat.com \
--cc=sgarzare@redhat.com \
--cc=stefanha@redhat.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 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).