[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191105162855.GK28764@mit.edu>
Date: Tue, 5 Nov 2019 11:28:55 -0500
From: "Theodore Y. Ts'o" <tytso@....edu>
To: Matthew Bobrowski <mbobrowski@...browski.org>
Cc: jack@...e.cz, adilger.kernel@...ger.ca, linux-ext4@...r.kernel.org,
linux-fsdevel@...r.kernel.org, riteshh@...ux.ibm.com
Subject: Re: [PATCH v7 11/11] ext4: introduce direct I/O write using iomap
infrastructure
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
Powered by blists - more mailing lists