Message ID | cd400f3194624bc6905384ba7cbb4a9e@tencent.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | 回复: [PATCH] mem-prealloc: initialize cond and mutex(Internet mail) | expand |
On 06.03.20 10:57, bauerchen(陈蒙蒙) wrote: > Very sorry for my fault, in fact,I test in a old qemu version ,and patch generated based a new one ; > All in all,its my fault, and I will check and test patch carefully In the future > If I need to submit the patch again ? Can you test and review my fixup? That will help Paolo to take my fix. > 发件人: Christian Borntraeger > 发送时间: 2020-03-06 16:50 > 收件人: qemu-devel > 抄送: qemu-s390x; Christian Borntraeger; bauerchen(陈蒙蒙); Paolo Bonzini; Marc Hartmayer > 主题: [PATCH] mem-prealloc: initialize cond and mutex(Internet mail) > 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 > > >
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
Very sorry for my fault, in fact,I test in a old qemu version ,and patch generated based a new one ; All in all,its my fault, and I will check and test patch carefully In the future If I need to submit the patch again ? 发件人: Christian Borntraeger 发送时间: 2020-03-06 16:50 收件人: qemu-devel 抄送: qemu-s390x; Christian Borntraeger; bauerchen(陈蒙蒙); Paolo Bonzini; Marc Hartmayer 主题: [PATCH] mem-prealloc: initialize cond and mutex(Internet mail) 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(+)