Re: [PATCH v4 08/15] btrfs: Stop using call_rcu for device freeing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Apr 01, 2019 at 08:20:56PM +0300, Nikolay Borisov wrote:
> 
> 
> On 1.04.19 г. 20:07 ч., David Sterba wrote:
> > On Wed, Mar 27, 2019 at 02:24:11PM +0200, Nikolay Borisov wrote:
> >> btrfs_device structs are freed from RCU context since device iteration
> >> is protected by RCU. Currently this is achieved by using call_rcu since
> >> no blocking functions are called within btrfs_free_device. Future
> >> refactoring of pending/pinned chunks will require calling sleeping
> >> functions. This patch is in preparation for these changes by simply
> >> switching from RCU callbacks to explicit calls of synchronize_rcu and
> >> calling btrfs_free_device directly.
> > 
> > A paragraph why this transition is correct would be good. It looks
> > correct to me, so this is a matter of documentation.
> 
> Well call_rcu and synchronize_rcu() are functionally equivalent in that
> they run the code that follows them after a grace period has expired.

This is enough to make the point about the correctness a bit more
explicit, patch updated. When there's too much implicit assumptions, eg.
about how RCU is used, then one sentence is ok to show that the patch
author knows what he's doing. It's like pointing to the right direction,
but repeating the whole mechanism is not necessary for the typical usage
patterns.



[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux