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 10/10] engines/libblkio: Share a single blkio instance among threads in same process
Date: Thu, 1 Dec 2022 12:29:53 -0500 [thread overview]
Message-ID: <8dad1bd9-480a-1951-af90-e8bb9d0dbff2@gmail.com> (raw)
In-Reply-To: <20221121182902.373491-11-afaria@redhat.com>
On 11/21/22 13:29, Alberto Faria wrote:
> fio groups all subjobs that set option 'thread' into a single process.
> Have them all share a single `struct blkio` instance, with one `struct
> blkioq` per thread/subjob. This allows benchmarking multi-queue setups.
>
> Note that `struct blkio` instances cannot be shared across different
> processes.
>
> Signed-off-by: Alberto Faria <afaria@redhat.com>
> ---
> HOWTO.rst | 8 +-
> engines/libblkio.c | 250 +++++++++++++++++++---
> examples/libblkio-io_uring.fio | 13 +-
> examples/libblkio-virtio-blk-vfio-pci.fio | 13 +-
> fio.1 | 7 +-
> 5 files changed, 257 insertions(+), 34 deletions(-)
>
> diff --git a/HOWTO.rst b/HOWTO.rst
> index 763f4f51..4e69abfc 100644
> --- a/HOWTO.rst
> +++ b/HOWTO.rst
> @@ -2199,7 +2199,13 @@ I/O engine
> :option:`libblkio_driver`. If
> :option:`mem`/:option:`iomem` is not specified, memory
> allocation is delegated to libblkio (and so is
> - guaranteed to work with the selected *driver*).
> + guaranteed to work with the selected *driver*). One
> + ``struct blkio`` instance is used per process, so all
> + jobs setting option :option:`thread` will share a single
> + ``struct blkio`` (with one queue per thread) and must
> + specify compatible options. Note that some drivers don't
> + allow several processes to access the same device or
> + file simultaneously, but allow it for threads.
>
> I/O engine specific parameters
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> diff --git a/engines/libblkio.c b/engines/libblkio.c
> index a80be66f..987dea4f 100644
> --- a/engines/libblkio.c
> +++ b/engines/libblkio.c
> @@ -249,6 +249,105 @@ static int fio_blkio_set_props_from_str(struct blkio *b, const char *opt_name,
> blkio_get_error_msg()); \
> })
>
> +static bool possibly_null_strs_equal(const char *a, const char *b)
> +{
> + return (!a && !b) || (a && b && strcmp(a, b) == 0);
> +}
> +
> +/*
> + * Returns the total number of subjobs using option 'thread' in the entire
> + * workload that have the given value for the 'hipri' option.
> + */
> +static int total_threaded_subjobs(bool hipri)
> +{
> + struct thread_data *td;
> + unsigned int i;
> + int count = 0;
> +
> + for_each_td(td, i) {
> + const struct fio_blkio_options *options = td->eo;
> + if (td->o.use_thread && (bool)options->hipri == hipri)
> + ++count;
> + }
> +
> + return count;
> +}
The loop should skip jobs not using the libblkio ioengine because, for
example, some ioengines don't have any ioengine options.
prev parent reply other threads:[~2022-12-01 17:29 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
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 [this message]
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=8dad1bd9-480a-1951-af90-e8bb9d0dbff2@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 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.