From: Markus Armbruster <armbru@redhat.com>
To: Nicolas Saenz Julienne <nsaenzju@redhat.com>
Cc: kwolf@redhat.com, fam@euphon.net, berrange@redhat.com,
qemu-block@nongnu.org, michael.roth@amd.com, mtosatti@redhat.com,
qemu-devel@nongnu.org, eduardo@habkost.net, hreitz@redhat.com,
stefanha@redhat.com, pbonzini@redhat.com, eblake@redhat.com
Subject: Re: [PATCH v4 3/3] util/event-loop-base: Introduce options to set the thread pool size
Date: Fri, 22 Apr 2022 13:15:47 +0200 [thread overview]
Message-ID: <87ilr1z7vg.fsf@pond.sub.org> (raw)
In-Reply-To: <20220401093523.873508-4-nsaenzju@redhat.com> (Nicolas Saenz Julienne's message of "Fri, 1 Apr 2022 11:35:23 +0200")
Nicolas Saenz Julienne <nsaenzju@redhat.com> writes:
> The thread pool regulates itself: when idle, it kills threads until
> empty, when in demand, it creates new threads until full. This behaviour
> doesn't play well with latency sensitive workloads where the price of
> creating a new thread is too high. For example, when paired with qemu's
> '-mlock', or using safety features like SafeStack, creating a new thread
> has been measured take multiple milliseconds.
>
> In order to mitigate this let's introduce a new 'EventLoopBase'
> property to set the thread pool size. The threads will be created during
> the pool's initialization or upon updating the property's value, remain
> available during its lifetime regardless of demand, and destroyed upon
> freeing it. A properly characterized workload will then be able to
> configure the pool to avoid any latency spikes.
>
> Signed-off-by: Nicolas Saenz Julienne <nsaenzju@redhat.com>
> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
[...]
> diff --git a/qapi/qom.json b/qapi/qom.json
> index e5f31c4469..06b8c3d10b 100644
> --- a/qapi/qom.json
> +++ b/qapi/qom.json
> @@ -506,9 +506,17 @@
> #
> # @aio-max-batch: maximum number of requests in a batch for the AIO engine,
> # 0 means that the engine will use its default.
> +#
> +# @thread-pool-min: minimum number of threads readily available in the thread
> +# pool (default:0, since 7.1)
What do you mean by "readily available in the thread pool"?
> +#
> +# @thread-pool-max: maximum number of threads the thread pool can contain
> +# (default:64, since 7.1)
> ##
If you add "Since: 7.1" in the previous patch, then the "since 7.1" here
need to go.
> { 'struct': 'EventLoopBaseProperties',
> - 'data': { '*aio-max-batch': 'int' } }
> + 'data': { '*aio-max-batch': 'int',
> + '*thread-pool-min': 'int',
> + '*thread-pool-max': 'int' } }
>
> ##
> # @IothreadProperties:
[...]
next prev parent reply other threads:[~2022-04-22 12:16 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-01 9:35 [PATCH v4 0/4] util/thread-pool: Expose minimun and maximum size Nicolas Saenz Julienne
2022-04-01 9:35 ` [PATCH v4 1/3] Introduce event-loop-base abstract class Nicolas Saenz Julienne
2022-04-01 9:35 ` [PATCH v4 2/3] util/main-loop: Introduce the main loop into QOM Nicolas Saenz Julienne
2022-04-22 11:13 ` Markus Armbruster
2022-04-22 11:40 ` Nicolas Saenz Julienne
2022-04-22 11:55 ` Nicolas Saenz Julienne
2022-04-01 9:35 ` [PATCH v4 3/3] util/event-loop-base: Introduce options to set the thread pool size Nicolas Saenz Julienne
2022-04-22 11:15 ` Markus Armbruster [this message]
2022-04-22 11:51 ` Nicolas Saenz Julienne
2022-04-22 12:45 ` Markus Armbruster
2022-04-04 8:42 ` [PATCH v4 0/4] util/thread-pool: Expose minimun and maximum size Nicolas Saenz Julienne
2022-04-04 9:29 ` Stefan Hajnoczi
2022-04-19 10:12 ` Nicolas Saenz Julienne
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=87ilr1z7vg.fsf@pond.sub.org \
--to=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=eblake@redhat.com \
--cc=eduardo@habkost.net \
--cc=fam@euphon.net \
--cc=hreitz@redhat.com \
--cc=kwolf@redhat.com \
--cc=michael.roth@amd.com \
--cc=mtosatti@redhat.com \
--cc=nsaenzju@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--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.