From: Dave Chinner <david@fromorbit.com>
To: Mingming Cao <cmm@us.ibm.com>
Cc: Ric Wheeler <rwheeler@redhat.com>,
James Bottomley <James.Bottomley@hansenpartnership.com>,
lsf@lists.linux-foundation.org,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
device-mapper development <dm-devel@redhat.com>
Subject: Re: [Lsf] Preliminary Agenda and Activities for LSF
Date: Wed, 30 Mar 2011 13:17:42 +1100 [thread overview]
Message-ID: <20110330021742.GL3008@dastard> (raw)
In-Reply-To: <1301445210.2731.14.camel@mingming-laptop>
On Tue, Mar 29, 2011 at 05:33:30PM -0700, Mingming Cao wrote:
> Ric,
>
> May I propose some discussion about concurrent direct IO support for
> ext4?
Just look at the way XFS does it and copy that? i.e. it has a
filesytem level IO lock and an inode lock both with shared/exclusive
semantics. These lie below the i_mutex (i.e. locking order is
i_mutex, i_iolock, i_ilock), and effectively result in the i_mutex
only being used for VFS level synchronisation and as such is rarely
used inside XFS itself.
Inode attribute operations are protected by the inode lock, while IO
operations and truncation synchronisation is provided by the IO
lock.
So for buffered IO, the IO lock is used in shared mode for reads
and exclusive mode for writes. This gives normal POSIX buffered IO
semantics and holding the IO lock exclusive allows sycnhronisation
against new IO of any kind for truncate.
For direct IO, the IO lock is always taken in shared mode, so we can
have concurrent read and write operations taking place at once
regardless of the offset into the file.
> I am looking for some discussion about removing the i_mutex lock in the
> direct IO write code path for ext4, when multiple threads are
> direct write to different offset of the same file. This would require
> some way to track the in-fly DIO IO range, either done at ext4 level or
> above th vfs layer.
Direct IO semantics have always been that the application is allowed
to overlap IO to the same range if it wants to. The result is
undefined (just like issuing overlapping reads and writes to a disk
at the same time) so it's the application's responsibility to avoid
overlapping IO if it is a problem.
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2011-03-30 2:17 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1301373398.2590.20.camel@mulgrave.site>
2011-03-29 11:16 ` [Lsf] Preliminary Agenda and Activities for LSF Ric Wheeler
2011-03-29 11:22 ` Matthew Wilcox
2011-03-29 12:17 ` Jens Axboe
2011-03-29 13:09 ` Martin K. Petersen
2011-03-29 13:12 ` Ric Wheeler
2011-03-29 13:38 ` James Bottomley
2011-03-29 17:20 ` Shyam_Iyer
2011-03-29 17:33 ` Vivek Goyal
2011-03-29 18:10 ` Shyam_Iyer
2011-03-29 18:45 ` Vivek Goyal
2011-03-29 19:13 ` Shyam_Iyer
2011-03-29 19:57 ` Vivek Goyal
2011-03-29 19:59 ` Mike Snitzer
2011-03-29 20:12 ` Shyam_Iyer
2011-03-29 20:23 ` Mike Snitzer
2011-03-29 23:09 ` Shyam_Iyer
2011-03-30 5:58 ` [Lsf] " Hannes Reinecke
2011-03-30 14:02 ` James Bottomley
2011-03-30 14:10 ` Hannes Reinecke
2011-03-30 14:26 ` James Bottomley
2011-03-30 14:55 ` Hannes Reinecke
2011-03-30 15:33 ` James Bottomley
2011-03-30 15:46 ` Shyam_Iyer
2011-03-30 20:32 ` Giridhar Malavali
2011-03-30 20:45 ` James Bottomley
2011-03-29 19:47 ` Nicholas A. Bellinger
2011-03-29 20:29 ` Jan Kara
2011-03-29 20:31 ` Ric Wheeler
2011-03-30 0:33 ` Mingming Cao
2011-03-30 2:17 ` Dave Chinner [this message]
2011-03-30 11:13 ` Theodore Tso
2011-03-30 11:28 ` Ric Wheeler
2011-03-30 14:07 ` Chris Mason
2011-04-01 15:19 ` Ted Ts'o
2011-04-01 16:30 ` Amir Goldstein
2011-04-01 21:46 ` Joel Becker
2011-04-02 3:26 ` Amir Goldstein
2011-04-01 21:43 ` Joel Becker
2011-03-30 21:49 ` Mingming Cao
2011-03-31 0:05 ` Matthew Wilcox
2011-03-31 1:00 ` Joel Becker
2011-04-01 21:34 ` Mingming Cao
2011-04-01 21:49 ` Joel Becker
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=20110330021742.GL3008@dastard \
--to=david@fromorbit.com \
--cc=James.Bottomley@hansenpartnership.com \
--cc=cmm@us.ibm.com \
--cc=dm-devel@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=lsf@lists.linux-foundation.org \
--cc=rwheeler@redhat.com \
/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).