All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Btrfs: remove rcu_barrier in btrfs_close_devices
@ 2017-10-10 21:51 Liu Bo
  2017-10-11  6:11 ` Anand Jain
  0 siblings, 1 reply; 5+ messages in thread
From: Liu Bo @ 2017-10-10 21:51 UTC (permalink / raw)
  To: linux-btrfs

It was introduced because btrfs used to do blkdev_put in a deferred
work, now that btrfs has put blkdev in place, this rcu_barrier can be
removed.

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
---
 fs/btrfs/volumes.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 0e8f16c..d983cea 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -958,12 +958,6 @@ int btrfs_close_devices(struct btrfs_fs_devices *fs_devices)
 		__btrfs_close_devices(fs_devices);
 		free_fs_devices(fs_devices);
 	}
-	/*
-	 * Wait for rcu kworkers under __btrfs_close_devices
-	 * to finish all blkdev_puts so device is really
-	 * free when umount is done.
-	 */
-	rcu_barrier();
 	return ret;
 }
 
-- 
2.9.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] Btrfs: remove rcu_barrier in btrfs_close_devices
  2017-10-10 21:51 [PATCH] Btrfs: remove rcu_barrier in btrfs_close_devices Liu Bo
@ 2017-10-11  6:11 ` Anand Jain
  2017-10-11  7:41   ` Anand Jain
  0 siblings, 1 reply; 5+ messages in thread
From: Anand Jain @ 2017-10-11  6:11 UTC (permalink / raw)
  To: Liu Bo, linux-btrfs, linux_lkml_grp



On 10/11/2017 05:51 AM, Liu Bo wrote:
> It was introduced because btrfs used to do blkdev_put in a deferred
> work, now that btrfs has put blkdev in place, this rcu_barrier can be
> removed.

  Reviewed-by: Anand Jain <anand.jain@oracle.com>

Thanks, Anand


> Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
> ---
>   fs/btrfs/volumes.c | 6 ------
>   1 file changed, 6 deletions(-)
> 
> diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
> index 0e8f16c..d983cea 100644
> --- a/fs/btrfs/volumes.c
> +++ b/fs/btrfs/volumes.c
> @@ -958,12 +958,6 @@ int btrfs_close_devices(struct btrfs_fs_devices *fs_devices)
>   		__btrfs_close_devices(fs_devices);
>   		free_fs_devices(fs_devices);
>   	}
> -	/*
> -	 * Wait for rcu kworkers under __btrfs_close_devices
> -	 * to finish all blkdev_puts so device is really
> -	 * free when umount is done.
> -	 */
> -	rcu_barrier();
>   	return ret;
>   }
>   
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Btrfs: remove rcu_barrier in btrfs_close_devices
  2017-10-11  6:11 ` Anand Jain
@ 2017-10-11  7:41   ` Anand Jain
  2017-10-11 17:02     ` Liu Bo
  0 siblings, 1 reply; 5+ messages in thread
From: Anand Jain @ 2017-10-11  7:41 UTC (permalink / raw)
  To: Liu Bo, linux-btrfs



On 10/11/2017 02:11 PM, Anand Jain wrote:
> 
> 
> On 10/11/2017 05:51 AM, Liu Bo wrote:
>> It was introduced because btrfs used to do blkdev_put in a deferred
>> work, now that btrfs has put blkdev in place, this rcu_barrier can be
>> removed.

  On the 2nd thought, modprobe -r btrfs would still need rcu_barrier(), 
some where else outside of umount context ?

Thanks, Anand


>   Reviewed-by: Anand Jain <anand.jain@oracle.com>
> 
> Thanks, Anand
> 
> 
>> Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
>> ---
>>   fs/btrfs/volumes.c | 6 ------
>>   1 file changed, 6 deletions(-)
>>
>> diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
>> index 0e8f16c..d983cea 100644
>> --- a/fs/btrfs/volumes.c
>> +++ b/fs/btrfs/volumes.c
>> @@ -958,12 +958,6 @@ int btrfs_close_devices(struct btrfs_fs_devices 
>> *fs_devices)
>>           __btrfs_close_devices(fs_devices);
>>           free_fs_devices(fs_devices);
>>       }
>> -    /*
>> -     * Wait for rcu kworkers under __btrfs_close_devices
>> -     * to finish all blkdev_puts so device is really
>> -     * free when umount is done.
>> -     */
>> -    rcu_barrier();
>>       return ret;
>>   }
>>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Btrfs: remove rcu_barrier in btrfs_close_devices
  2017-10-11  7:41   ` Anand Jain
@ 2017-10-11 17:02     ` Liu Bo
  2017-10-30 16:25       ` David Sterba
  0 siblings, 1 reply; 5+ messages in thread
From: Liu Bo @ 2017-10-11 17:02 UTC (permalink / raw)
  To: Anand Jain; +Cc: linux-btrfs

On Wed, Oct 11, 2017 at 03:41:23PM +0800, Anand Jain wrote:
> 
> 
> On 10/11/2017 02:11 PM, Anand Jain wrote:
> > 
> > 
> > On 10/11/2017 05:51 AM, Liu Bo wrote:
> > > It was introduced because btrfs used to do blkdev_put in a deferred
> > > work, now that btrfs has put blkdev in place, this rcu_barrier can be
> > > removed.
> 
>  On the 2nd thought, modprobe -r btrfs would still need rcu_barrier(), some
> where else outside of umount context ?

Thanks a lot for the comments.

modprobe -r btrfs will do btrfs_cleanup_fs_uuids(), where it cleanup
every %fs_devices on the list, but when we do btrfs_close_devices(), we
have replaced the devices on the list with dummy ones which only have
the same name and uuid, so modprobe -r btrfs will free those instead
of what we were using, this change won't cause a problem for it.

Thanks,

-liubo
> 
> Thanks, Anand
> 
> 
> >   Reviewed-by: Anand Jain <anand.jain@oracle.com>
> > 
> > Thanks, Anand
> > 
> > 
> > > Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
> > > ---
> > >   fs/btrfs/volumes.c | 6 ------
> > >   1 file changed, 6 deletions(-)
> > > 
> > > diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
> > > index 0e8f16c..d983cea 100644
> > > --- a/fs/btrfs/volumes.c
> > > +++ b/fs/btrfs/volumes.c
> > > @@ -958,12 +958,6 @@ int btrfs_close_devices(struct btrfs_fs_devices
> > > *fs_devices)
> > >           __btrfs_close_devices(fs_devices);
> > >           free_fs_devices(fs_devices);
> > >       }
> > > -    /*
> > > -     * Wait for rcu kworkers under __btrfs_close_devices
> > > -     * to finish all blkdev_puts so device is really
> > > -     * free when umount is done.
> > > -     */
> > > -    rcu_barrier();
> > >       return ret;
> > >   }
> > > 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Btrfs: remove rcu_barrier in btrfs_close_devices
  2017-10-11 17:02     ` Liu Bo
@ 2017-10-30 16:25       ` David Sterba
  0 siblings, 0 replies; 5+ messages in thread
From: David Sterba @ 2017-10-30 16:25 UTC (permalink / raw)
  To: Liu Bo; +Cc: Anand Jain, linux-btrfs

On Wed, Oct 11, 2017 at 11:02:49AM -0600, Liu Bo wrote:
> On Wed, Oct 11, 2017 at 03:41:23PM +0800, Anand Jain wrote:
> > 
> > 
> > On 10/11/2017 02:11 PM, Anand Jain wrote:
> > > 
> > > 
> > > On 10/11/2017 05:51 AM, Liu Bo wrote:
> > > > It was introduced because btrfs used to do blkdev_put in a deferred
> > > > work, now that btrfs has put blkdev in place, this rcu_barrier can be
> > > > removed.
> > 
> >  On the 2nd thought, modprobe -r btrfs would still need rcu_barrier(), some
> > where else outside of umount context ?
> 
> Thanks a lot for the comments.
> 
> modprobe -r btrfs will do btrfs_cleanup_fs_uuids(), where it cleanup
> every %fs_devices on the list, but when we do btrfs_close_devices(), we
> have replaced the devices on the list with dummy ones which only have
> the same name and uuid, so modprobe -r btrfs will free those instead
> of what we were using, this change won't cause a problem for it.

Added to the changelog.

Reviewed-by: David Sterba <dsterba@suse.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-10-30 16:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-10 21:51 [PATCH] Btrfs: remove rcu_barrier in btrfs_close_devices Liu Bo
2017-10-11  6:11 ` Anand Jain
2017-10-11  7:41   ` Anand Jain
2017-10-11 17:02     ` Liu Bo
2017-10-30 16:25       ` David Sterba

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.