From: Jan Kara <jack@suse.cz>
To: Ted Tso <tytso@mit.edu>
Cc: linux-ext4@vger.kernel.org, Jan Kara <jack@suse.cz>
Subject: [PATCH 0/6] ext4: Clean up io_end handling for AIO DIO
Date: Fri, 19 Feb 2016 16:59:36 +0100 [thread overview]
Message-ID: <1455897582-13292-1-git-send-email-jack@suse.cz> (raw)
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
next reply other threads:[~2016-02-19 15:59 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-19 15:59 Jan Kara [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1455897582-13292-1-git-send-email-jack@suse.cz \
--to=jack@suse.cz \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).