qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 1/1] oslib-posix: initialize backend memory objects in par


From: Mark Kanda
Subject: Re: [PATCH v3 1/1] oslib-posix: initialize backend memory objects in parallel
Date: Wed, 31 Jan 2024 09:02:09 -0600
User-agent: Mozilla Thunderbird



On 1/31/24 8:57 AM, David Hildenbrand wrote:
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.


Yep. OK, I'll go with that.

Thanks again!



reply via email to

[Prev in Thread] Current Thread [Next in Thread]