qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Mark Kanda <mark.kanda@oracle.com>, qemu-devel@nongnu.org
Cc: pbonzini@redhat.com, berrange@redhat.com
Subject: Re: [PATCH v3 1/1] oslib-posix: initialize backend memory objects in parallel
Date: Wed, 31 Jan 2024 15:57:09 +0100	[thread overview]
Message-ID: <00584dd7-f89f-4595-903b-54fbff260983@redhat.com> (raw)
In-Reply-To: <6a5773e2-6887-4cd6-995a-209affd71b74@oracle.com>

On 31.01.24 15:48, Mark Kanda wrote:
> On 1/31/24 8:30 AM, David Hildenbrand wrote:
>>>
>>> OK. I'll call it 'PHASE_LATE_BACKENDS_CREATED' (to make it consistent
>>> with code comments/function name).
>>
>> But then, you should set it at the very end of the function (not sure
>> if that would be a problem with the other devices that are getting
>> created in between -- if they would be using one of these memory
>> backends; likely not).
>>
> 
> I think I misunderstood your suggestion. I was planning to add it a
> 'phase_advance(PHASE_LATE_BACKENDS_CREATED)' to qemu_init():
> 
>      @@ -3703,6 +3703,7 @@ void qemu_init(int argc, char **argv)
>             * over memory-backend-file objects).
>             */
>            qemu_create_late_backends();
>      +    phase_advance(PHASE_LATE_BACKENDS_CREATED);
> 
> And use PHASE_LATE_BACKENDS_CREATED (instead of
> PHASE_MACHINE_INITIALIZED) for the async bool in
> host_memory_backend_memory_complete().
> 
> I was planning to leave this call where it is:
> 
>      @@ -2009,6 +2009,14 @@ static void qemu_create_late_backends(void)
> 
>            object_option_foreach_add(object_create_late);
> 
>      +    /*
>      +     * Wait for any outstanding memory prealloc from created memory
>      +     * backends to complete.
>      +     */
>      +    if (!qemu_finish_async_mem_prealloc(&error_fatal)) {
>      +        exit(1);
>      +    }
>      +
>            if (tpm_init() < 0) {
>                exit(1);
>            }
> 

Yes. The only "suboptimal" things is that if someone where to create a 
memory backend between qemu_finish_async_mem_prealloc() and 
phase_advance(PHASE_LATE_BACKENDS_CREATED), it would never get preallocated.

That likely won't ever happen by any of the remaining stuff in 
qemu_create_late_backends(), especially not with "prealloc=on" and 
thread-contexts set.

-- 
Cheers,

David / dhildenb



  reply	other threads:[~2024-01-31 14:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-31 13:48 [PATCH v3 0/1] Initialize backend memory objects in parallel Mark Kanda
2024-01-31 13:48 ` [PATCH v3 1/1] oslib-posix: initialize " Mark Kanda
2024-01-31 14:04   ` David Hildenbrand
2024-01-31 14:27     ` Mark Kanda
2024-01-31 14:30       ` David Hildenbrand
2024-01-31 14:48         ` Mark Kanda
2024-01-31 14:57           ` David Hildenbrand [this message]
2024-01-31 15:02             ` Mark Kanda

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=00584dd7-f89f-4595-903b-54fbff260983@redhat.com \
    --to=david@redhat.com \
    --cc=berrange@redhat.com \
    --cc=mark.kanda@oracle.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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).