qemu-s390x
[Top][All Lists]
Advanced

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

Re: [PATCH] mem-prealloc: initialize cond and mutex


From: Paolo Bonzini
Subject: Re: [PATCH] mem-prealloc: initialize cond and mutex
Date: Fri, 6 Mar 2020 10:06:11 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1

On 06/03/20 09:50, Christian Borntraeger wrote:
> Guests with mem-prealloc do fail with
> qemu-system-s390x: /home/cborntra/REPOS/qemu/util/qemu-thread-posix.c:76: 
> qemu_mutex_lock_impl: Assertion `mutex->initialized' failed.
> qemu-system-s390x: /home/cborntra/REPOS/qemu/util/qemu-thread-posix.c:161: 
> qemu_cond_broadcast: Assertion `cond->initialized' failed.
> 
> Let us initialize cond and mutex.
> 
> Cc: bauerchen <address@hidden>
> Cc: Paolo Bonzini <address@hidden>
> Reported-by: Marc Hartmayer <address@hidden>
> Fixes: 037fb5eb3941 ("mem-prealloc: optimize large guest startup")
> Signed-off-by: Christian Borntraeger <address@hidden>
> ---
>  util/oslib-posix.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/util/oslib-posix.c b/util/oslib-posix.c
> index 897e8f3ba6..52650183d3 100644
> --- a/util/oslib-posix.c
> +++ b/util/oslib-posix.c
> @@ -470,6 +470,8 @@ static bool touch_all_pages(char *area, size_t hpagesize, 
> size_t numpages,
>      char *addr = area;
>      int i = 0;
>  
> +    qemu_cond_init(&page_cond);
> +    qemu_mutex_init(&page_mutex);
>      memset_thread_failed = false;
>      threads_created_flag = false;
>      memset_num_threads = get_memset_num_threads(smp_cpus);
> 

Thank you very much.  It's my fault, but is it too much to ask that
submitters test their patches???

Paolo




reply via email to

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