linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] ext4: Clean up io_end handling for AIO DIO
@ 2016-02-19 15:59 Jan Kara
  2016-02-19 15:59 ` [PATCH 1/6] ext4: Pack ioend structure better Jan Kara
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: Jan Kara @ 2016-02-19 15:59 UTC (permalink / raw)
  To: Ted Tso; +Cc: linux-ext4, Jan Kara

Hello,

Recently I had a look at how io_ends are handled for AIO DIO. When doing AIO
DIO we allocate io_end and attach it to inode. ext4_ext_map_blocks() then
fetches io_end from inode and operates on it. This scheme is somewhat fragile
because it relies on the fact that we hold i_mutex whenever we need io_end
which is non-obvious dependency (if it was not for io_end handling, i_data_sem
would be enough). dioread_nolock mode broke this assumption and was corrupting
io_end pointers until recently which somewhat demostrates my point.

This patch set converts ext4 to allocate io_end only once we spot unwritten
extent during direct IO write and uses bh->b_private and dio->private
to store it in the same fashion as XFS. That way passing of io_end pointer
happens via IO-local context and is thus independent of any locks.

The core of the change is in patch 5/6, the rest are related cleanups and
preparations for the change.

Patches pass xfstests in normal and dioread_nolock mode. Patch 5/6 conflicts
with changes of DIO completion on error however resolving these conflicts
should be straightforward.

								Honza

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

end of thread, other threads:[~2016-03-09  4:53 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-19 15:59 [PATCH 0/6] ext4: Clean up io_end handling for AIO DIO Jan Kara
2016-02-19 15:59 ` [PATCH 1/6] ext4: Pack ioend structure better Jan Kara
2016-03-09  3:39   ` Theodore Ts'o
2016-02-19 15:59 ` [PATCH 2/6] ext4: Use i_mutex to serialize unaligned AIO DIO Jan Kara
2016-03-09  3:53   ` Theodore Ts'o
2016-02-19 15:59 ` [PATCH 3/6] ext4: Rename and split get blocks functions Jan Kara
2016-03-09  4:09   ` Theodore Ts'o
2016-02-19 15:59 ` [PATCH 4/6] ext4: Move trans handling and completion deferal out of _ext4_get_block Jan Kara
2016-03-09  4:27   ` Theodore Ts'o
2016-02-19 15:59 ` [PATCH 5/6] ext4: Simplify io_end handling for AIO DIO Jan Kara
2016-03-09  4:38   ` Theodore Ts'o
2016-02-19 15:59 ` [PATCH 6/6] ext4: Remove i_ioend_count Jan Kara
2016-03-09  4:53   ` Theodore Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).