Re: [Qemu-devel] [PATCH for-2.11] rcu: init globals only once

2017-08-08 Thread Peter Xu
On Tue, Aug 08, 2017 at 09:09:23AM -0500, Eric Blake wrote: > On 08/08/2017 02:49 AM, Peter Xu wrote: > >> This doesn't work for error-checking mutexes: rcu_init_child has a > >> different PID than the parent, so the mutexes aren't unlocked. It's > >> also true that right now we don't use error-ch

Re: [Qemu-devel] [PATCH for-2.11] rcu: init globals only once

2017-08-08 Thread Eric Blake
On 08/08/2017 02:49 AM, Peter Xu wrote: >> This doesn't work for error-checking mutexes: rcu_init_child has a >> different PID than the parent, so the mutexes aren't unlocked. It's >> also true that right now we don't use error-checking mutexes (commit >> 24fa90499f, "qemu-thread: do not use PTHRE

Re: [Qemu-devel] [PATCH for-2.11] rcu: init globals only once

2017-08-08 Thread Paolo Bonzini
On 08/08/2017 09:49, Peter Xu wrote: > On Tue, Aug 08, 2017 at 09:26:43AM +0200, Paolo Bonzini wrote: >> On 08/08/2017 09:00, Peter Xu wrote: >>> We were calling rcu_init_complete() twice in the child processes when >>> fork happened. However the pthread library does not really suggest to do >>> it

Re: [Qemu-devel] [PATCH for-2.11] rcu: init globals only once

2017-08-08 Thread Peter Xu
On Tue, Aug 08, 2017 at 09:26:43AM +0200, Paolo Bonzini wrote: > On 08/08/2017 09:00, Peter Xu wrote: > > We were calling rcu_init_complete() twice in the child processes when > > fork happened. However the pthread library does not really suggest to do > > it that way: > > > > http://pubs.opengrou

Re: [Qemu-devel] [PATCH for-2.11] rcu: init globals only once

2017-08-08 Thread Paolo Bonzini
On 08/08/2017 09:00, Peter Xu wrote: > We were calling rcu_init_complete() twice in the child processes when > fork happened. However the pthread library does not really suggest to do > it that way: > > http://pubs.opengroup.org/onlinepubs/7908799/xsh/pthread_mutex_init.html > > "Attempting to in

[Qemu-devel] [PATCH for-2.11] rcu: init globals only once

2017-08-08 Thread Peter Xu
We were calling rcu_init_complete() twice in the child processes when fork happened. However the pthread library does not really suggest to do it that way: http://pubs.opengroup.org/onlinepubs/7908799/xsh/pthread_mutex_init.html "Attempting to initialise an already initialised mutex results in u