Re: [PATCH 4/9] btrfs: Switch to iomap_dio_rw() for dio

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

 



On Thu, Mar 26, 2020 at 04:02:49PM -0500, Goldwyn Rodrigues wrote:
> BTRFS direct I/O is now done under i_rwsem, shared in case of
> reads and exclusive in case of writes. This guards against simultaneous
> truncates.

Btw, you really want to add the optimization of only taking it shared
for all the easy write cases similar to what XFS has done for ages
and what ext4 picked up now.  Without that performance on someworkloads
is going to be horrible.  That could be a patch on top of this one,
though.

> +/*
> + * btrfs_direct_IO - perform direct I/O
> + * inode->i_rwsem must be locked before calling this function, shared or exclusive.
> + * @iocb - kernel iocb
> + * @iter - iter to/from data is copied

This adds a way too long line.  Also kerneldoc comments go below the
arguments.  Last but not least a lockdep_assert_held is much more useful
than comments trying to document locking 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