On 09.03.20 11:05, Paolo Bonzini wrote: > On 09/03/20 11:03, Igor Mammedov wrote: >>> + qemu_cond_init(&page_cond); >>> + qemu_mutex_init(&page_mutex); >> Is it possible for touch_all_pages to be called several times? >> If it's then it probably needs a guard against that to make >> sure it won't explode, something like: >> >> static bool page_mutex_inited; >> >> if(page_mutex_inited) >> page_mutex_inited = true >> qemu_mutex_init(&page_mutex) >> ... >> > > Hmm, good idea, it should also use GOnce. Maybe start with a revert and let the original submitter send a fixed up patch?
- [PATCH] mem-prealloc: initialize cond and mutex Christian Borntraeger
- Re: [PATCH] mem-prealloc: initialize cond and m... Paolo Bonzini
- 回复: [PATCH] mem-prealloc: initialize cond and m... 陈蒙蒙
- Re: 回复: [PATCH] mem-prealloc: initialize co... Christian Borntraeger
- Re: [PATCH] mem-prealloc: initialize cond and m... Igor Mammedov
- Re: [PATCH] mem-prealloc: initialize cond a... Paolo Bonzini
- Re: [PATCH] mem-prealloc: initialize co... Christian Borntraeger
- Re: Re: [PATCH] mem-prealloc: initi... 陈蒙蒙
- Re: [PATCH] mem-prealloc: init... Igor Mammedov
- Re: Re: [PATCH] mem-preall... 陈蒙蒙
- Re: [PATCH] mem-preall... Paolo Bonzini
- Re: Re: [PATCH] mem-pr... 陈蒙蒙