Re: [PATCH v7 11/11] ext4: introduce direct I/O write using iomap infrastructure

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

 



On Tue, Nov 05, 2019 at 11:02:39PM +1100, Matthew Bobrowski wrote:
> +	ret = iomap_dio_rw(iocb, from, &ext4_iomap_ops, &ext4_dio_write_ops,
> +			   is_sync_kiocb(iocb) || unaligned_aio || extend);
> +
> +	if (extend)
> +		ret = ext4_handle_inode_extension(inode, offset, ret, count);
> +

Can we do a slight optimization here like this?

	ret = iomap_dio_rw(iocb, from, &ext4_iomap_ops, &ext4_dio_write_ops,
			   is_sync_kiocb(iocb) || unaligned_aio || extend);

	if (extend && ret != -EBIOCQUEUED)
		ret = ext4_handle_inode_extension(inode, offset, ret, count);


If iomap_dio_rw() returns -EBIOCQUEUED, there's no need to do any of
the ext4_handle_inode_extension --- in particular, there's no need to
call ext4_truncate_failed_write(), which has a bunch of extra
overhead, including taking and releasing i_data_sem.

	  	    	       		 - Ted



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux