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

2019-09-11 Thread Dr. David Alan Gilbert
* Eric Blake (ebl...@redhat.com) wrote: > On 9/11/19 11:42 AM, 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 infrastrcture (and thus whatever the compilers hooks are) to > > release it on

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

2019-09-11 Thread Dr. David Alan Gilbert
* Eric Blake (ebl...@redhat.com) wrote: > On 9/11/19 11:56 AM, Daniel P. Berrangé wrote: > > On Wed, Sep 11, 2019 at 05:42:00PM +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 > >

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

2019-09-11 Thread Dr. David Alan Gilbert
* Eric Blake (ebl...@redhat.com) wrote: > On 9/11/19 12:40 PM, Eric Blake wrote: > > >> + > >> +#define RCU_READ_LOCK_AUTO g_auto(rcu_read_auto_t) \ > >> +_rcu_read_auto = 'x'; \ > > > > I'm a bit lost at where _rcu_read_auto is declared. (I could understand > > if an earlier macro had

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

2019-09-11 Thread Eric Blake
On 9/11/19 11:56 AM, Daniel P. Berrangé wrote: > On Wed, Sep 11, 2019 at 05:42:00PM +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 spurious double space >> g_auto infrastrcture (and thus

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

2019-09-11 Thread Eric Blake
On 9/11/19 12:40 PM, Eric Blake wrote: >> + >> +#define RCU_READ_LOCK_AUTO g_auto(rcu_read_auto_t) \ >> +_rcu_read_auto = 'x'; \ > > I'm a bit lost at where _rcu_read_auto is declared. (I could understand > if an earlier macro had created that typedef via concatenating _ with >

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

2019-09-11 Thread Eric Blake
On 9/11/19 11:42 AM, 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 infrastrcture (and thus whatever the compilers hooks are) to > release it on all exits of the block. > > Note this macro has a

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

2019-09-11 Thread Dr. David Alan Gilbert
* Daniel P. Berrangé (berra...@redhat.com) wrote: > On Wed, Sep 11, 2019 at 06:10:28PM +0100, Dr. David Alan Gilbert wrote: > > * Daniel P. Berrangé (berra...@redhat.com) wrote: > > > On Wed, Sep 11, 2019 at 06:04:23PM +0100, Dr. David Alan Gilbert wrote: > > > > * Daniel P. Berrangé

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

2019-09-11 Thread Daniel P . Berrangé
On Wed, Sep 11, 2019 at 06:10:28PM +0100, Dr. David Alan Gilbert wrote: > * Daniel P. Berrangé (berra...@redhat.com) wrote: > > On Wed, Sep 11, 2019 at 06:04:23PM +0100, Dr. David Alan Gilbert wrote: > > > * Daniel P. Berrangé (berra...@redhat.com) wrote: > > > > On Wed, Sep 11, 2019 at 05:42:00PM

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

2019-09-11 Thread Dr. David Alan Gilbert
* Daniel P. Berrangé (berra...@redhat.com) wrote: > On Wed, Sep 11, 2019 at 06:04:23PM +0100, Dr. David Alan Gilbert wrote: > > * Daniel P. Berrangé (berra...@redhat.com) wrote: > > > On Wed, Sep 11, 2019 at 05:42:00PM +0100, Dr. David Alan Gilbert (git) > > > wrote: > > > > From: "Dr. David Alan

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

2019-09-11 Thread Daniel P . Berrangé
On Wed, Sep 11, 2019 at 06:04:23PM +0100, Dr. David Alan Gilbert wrote: > * Daniel P. Berrangé (berra...@redhat.com) wrote: > > On Wed, Sep 11, 2019 at 05:42:00PM +0100, Dr. David Alan Gilbert (git) > > wrote: > > > From: "Dr. David Alan Gilbert" > > > > > > RCU_READ_LOCK_AUTO takes the

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

2019-09-11 Thread Dr. David Alan Gilbert
* Daniel P. Berrangé (berra...@redhat.com) wrote: > On Wed, Sep 11, 2019 at 05:42:00PM +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 infrastrcture (and thus whatever the compilers

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

2019-09-11 Thread Daniel P . Berrangé
On Wed, Sep 11, 2019 at 05:42:00PM +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 infrastrcture (and thus whatever the compilers hooks are) to > release it on all exits of the block. > >

[Qemu-devel] [PATCH 1/3] 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 infrastrcture (and thus whatever the compilers hooks are) to release it on all exits of the block. Note this macro has a variable declaration in, and hence is not in a while loop.