qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Denis Plotnikov <den-plotnikov@yandex-team.ru>, qemu-devel@nongnu.org
Cc: yc-core@yandex-team.ru
Subject: Re: [PATCH v1] softmmu/vl: make default prealloc-threads work w/o -mem-prealloc
Date: Thu, 11 Mar 2021 11:31:55 +0100	[thread overview]
Message-ID: <c59f700a-3836-6121-7c4e-a811ec486808@redhat.com> (raw)
In-Reply-To: <20210311085918.284903-1-den-plotnikov@yandex-team.ru>

On 11/03/21 09:59, Denis Plotnikov wrote:
> Preallocation in memory backends can be specified with either global
> QEMU option "-mem-prealloc", or with per-backend property
> "prealloc=true".  In the latter case, however, the default for the
> number of preallocation threads is not set to the number of vcpus, but
> remains at 1 instead.
> 
> Fix it by setting the "prealloc-threads" sugar property of
> "memory-backend" to the number of vcpus unconditionally.
> 
> Fixes: ffac16fab3 ("hostmem: introduce "prealloc-threads" property")
> 
> Signed-off-by: Denis Plotnikov <den-plotnikov@yandex-team.ru>
> ---
>   softmmu/vl.c | 17 ++++++++++-------
>   1 file changed, 10 insertions(+), 7 deletions(-)
> 
> diff --git a/softmmu/vl.c b/softmmu/vl.c
> index ff488ea3e7db..e392e226a2d3 100644
> --- a/softmmu/vl.c
> +++ b/softmmu/vl.c
> @@ -2300,14 +2300,17 @@ static void qemu_validate_options(void)
>   
>   static void qemu_process_sugar_options(void)
>   {
> -    if (mem_prealloc) {
> -        char *val;
> +    char *val;
>   
> -        val = g_strdup_printf("%d",
> -                 (uint32_t) qemu_opt_get_number(qemu_find_opts_singleton("smp-opts"), "cpus", 1));
> -        object_register_sugar_prop("memory-backend", "prealloc-threads", val,
> -                                   false);
> -        g_free(val);
> +    val = g_strdup_printf("%d",
> +              (uint32_t) qemu_opt_get_number(
> +                             qemu_find_opts_singleton("smp-opts"), "cpus", 1));
> +
> +    object_register_sugar_prop("memory-backend", "prealloc-threads", val,
> +                                false);
> +    g_free(val);
> +
> +    if (mem_prealloc) {
>           object_register_sugar_prop("memory-backend", "prealloc", "on", false);
>       }
>   
> 

Queued, thanks.

Paolo



  reply	other threads:[~2021-03-11 10:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-11  8:59 [PATCH v1] softmmu/vl: make default prealloc-threads work w/o -mem-prealloc Denis Plotnikov
2021-03-11 10:31 ` Paolo Bonzini [this message]
2021-05-05 15:31 ` Paolo Bonzini
2021-05-17 14:33 ` Igor Mammedov

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=c59f700a-3836-6121-7c4e-a811ec486808@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=den-plotnikov@yandex-team.ru \
    --cc=qemu-devel@nongnu.org \
    --cc=yc-core@yandex-team.ru \
    /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).