Re: [Qemu-devel] [PATCH v2 1/5] rcu: Add automatically released rcu_read_lock variant

2019-09-13 Thread Paolo Bonzini
On 13/09/19 12:24, Dr. David Alan Gilbert wrote: >> We could also add LOCK_GUARD(lock) and WITH_LOCK_GUARD(lock), using >> QemuLockable for polymorphism. I even had patches a while ago (though >> they used something like LOCK_GUARD(guard_var, lock). I think we >> dropped them because of fear

Re: [Qemu-devel] [PATCH v2 1/5] rcu: Add automatically released rcu_read_lock variant

2019-09-13 Thread Dr. David Alan Gilbert
* Paolo Bonzini (pbonz...@redhat.com) wrote: > On 12/09/19 19:45, Dr. David Alan Gilbert wrote: > > Do you think it's best to use the block version for all cases > > or to use the non-block version by taste? > > The block version is quite nice, but that turns most of the patches > > into 'indent

Re: [Qemu-devel] [PATCH v2 1/5] rcu: Add automatically released rcu_read_lock variant

2019-09-13 Thread Paolo Bonzini
On 12/09/19 19:45, Dr. David Alan Gilbert wrote: > Do you think it's best to use the block version for all cases > or to use the non-block version by taste? > The block version is quite nice, but that turns most of the patches > into 'indent everything'. I don't really know myself. On first

Re: [Qemu-devel] [PATCH v2 1/5] rcu: Add automatically released rcu_read_lock variant

2019-09-12 Thread Dr. David Alan Gilbert
* Paolo Bonzini (pbonz...@redhat.com) wrote: > On 11/09/19 21:06, Dr. David Alan Gilbert (git) wrote: > > From: "Dr. David Alan Gilbert" > > > > RCU_READ_LOCK_AUTO takes the rcu_read_lock and then uses glib's > > g_auto infrastructure (and thus whatever the compiler's hooks are) to > > release

Re: [Qemu-devel] [PATCH v2 1/5] rcu: Add automatically released rcu_read_lock variant

2019-09-12 Thread Paolo Bonzini
On 11/09/19 21:06, Dr. David Alan Gilbert (git) wrote: > From: "Dr. David Alan Gilbert" > > RCU_READ_LOCK_AUTO takes the rcu_read_lock and then uses glib's > g_auto infrastructure (and thus whatever the compiler's hooks are) to > release it on all exits of the block. > > Signed-off-by: Dr.

Re: [Qemu-devel] [PATCH v2 1/5] rcu: Add automatically released rcu_read_lock variant

2019-09-12 Thread Daniel P . Berrangé
On Wed, Sep 11, 2019 at 08:06:18PM +0100, Dr. David Alan Gilbert (git) wrote: > From: "Dr. David Alan Gilbert" > > RCU_READ_LOCK_AUTO takes the rcu_read_lock and then uses glib's > g_auto infrastructure (and thus whatever the compiler's hooks are) to > release it on all exits of the block. > >

[Qemu-devel] [PATCH v2 1/5] rcu: Add automatically released rcu_read_lock variant

2019-09-11 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" RCU_READ_LOCK_AUTO takes the rcu_read_lock and then uses glib's g_auto infrastructure (and thus whatever the compiler's hooks are) to release it on all exits of the block. Signed-off-by: Dr. David Alan Gilbert --- include/qemu/rcu.h | 18 ++ 1