qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mem-prealloc: initialize cond and mutex
@ 2020-03-06  8:50 Christian Borntraeger
  2020-03-06  9:06 ` Paolo Bonzini
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Christian Borntraeger @ 2020-03-06  8:50 UTC (permalink / raw)
  To: qemu-devel
  Cc: Christian Borntraeger, qemu-s390x, Marc Hartmayer, bauerchen,
	Paolo Bonzini

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 <bauerchen@tencent.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Reported-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Fixes: 037fb5eb3941 ("mem-prealloc: optimize large guest startup")
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
 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);
-- 
2.25.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-03-12  5:06 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-06  8:50 [PATCH] mem-prealloc: initialize cond and mutex Christian Borntraeger
2020-03-06  9:06 ` Paolo Bonzini
2020-03-06  9:57 ` 回复: [PATCH] mem-prealloc: initialize cond and mutex(Internet mail) bauerchen(陈蒙蒙)
2020-03-09  9:17   ` Christian Borntraeger
2020-03-09 10:03 ` [PATCH] mem-prealloc: initialize cond and mutex Igor Mammedov
2020-03-09 10:05   ` Paolo Bonzini
2020-03-09 11:01     ` Christian Borntraeger
2020-03-09 11:16       ` Re: [PATCH] mem-prealloc: initialize cond and mutex(Internet mail) bauerchen(陈蒙蒙)
2020-03-09 13:19         ` Igor Mammedov
2020-03-10  7:06           ` bauerchen(陈蒙蒙)
2020-03-11 18:34             ` Paolo Bonzini
2020-03-12  5:05               ` bauerchen(陈蒙蒙)

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).