Re: [Qemu-devel] [PATCH 2/3] migration: Use automatic rcu_read unlock in ram.c

2019-09-11 Thread Dr. David Alan Gilbert
* Daniel P. Berrangé (berra...@redhat.com) wrote:
> On Wed, Sep 11, 2019 at 05:42:01PM +0100, Dr. David Alan Gilbert (git) wrote:
> > From: "Dr. David Alan Gilbert" 
> > 
> > Use the automatic read unlocker in migration/ram.c;
> > only for the cases where the unlock is at the end of the function.
> > 
> > Signed-off-by: Dr. David Alan Gilbert 
> > ---
> >  migration/ram.c | 25 +
> >  1 file changed, 9 insertions(+), 16 deletions(-)
> > 
> > diff --git a/migration/ram.c b/migration/ram.c
> > index b2bd618a89..750d198f37 100644
> > --- a/migration/ram.c
> > +++ b/migration/ram.c
> > @@ -181,14 +181,14 @@ int foreach_not_ignored_block(RAMBlockIterFunc func, 
> > void *opaque)
> >  RAMBlock *block;
> >  int ret = 0;
> >  
> > -rcu_read_lock();
> > +RCU_READ_LOCK_AUTO
> 
> FWIW, I'm not a fan of macros which are used without a trailing ';'
> as I believe it can confuses editors' code indentation logic.

Added.

> 
> Regards,
> Daniel
> -- 
> |: https://berrange.com  -o-https://www.flickr.com/photos/dberrange :|
> |: https://libvirt.org -o-https://fstop138.berrange.com :|
> |: https://entangle-photo.org-o-https://www.instagram.com/dberrange :|
--
Dr. David Alan Gilbert / dgilb...@redhat.com / Manchester, UK



Re: [Qemu-devel] [PATCH 2/3] migration: Use automatic rcu_read unlock in ram.c

2019-09-11 Thread Daniel P . Berrangé
On Wed, Sep 11, 2019 at 05:42:01PM +0100, Dr. David Alan Gilbert (git) wrote:
> From: "Dr. David Alan Gilbert" 
> 
> Use the automatic read unlocker in migration/ram.c;
> only for the cases where the unlock is at the end of the function.
> 
> Signed-off-by: Dr. David Alan Gilbert 
> ---
>  migration/ram.c | 25 +
>  1 file changed, 9 insertions(+), 16 deletions(-)
> 
> diff --git a/migration/ram.c b/migration/ram.c
> index b2bd618a89..750d198f37 100644
> --- a/migration/ram.c
> +++ b/migration/ram.c
> @@ -181,14 +181,14 @@ int foreach_not_ignored_block(RAMBlockIterFunc func, 
> void *opaque)
>  RAMBlock *block;
>  int ret = 0;
>  
> -rcu_read_lock();
> +RCU_READ_LOCK_AUTO

FWIW, I'm not a fan of macros which are used without a trailing ';'
as I believe it can confuses editors' code indentation logic.


Regards,
Daniel
-- 
|: https://berrange.com  -o-https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o-https://fstop138.berrange.com :|
|: https://entangle-photo.org-o-https://www.instagram.com/dberrange :|