From: David Chinner <dgc@sgi.com>
To: Chris Mason <chris.mason@oracle.com>
Cc: David Chinner <dgc@sgi.com>,
linux-fsdevel@vger.kernel.org, akpm@osdl.org,
zach.brown@oracle.com, Suparna Bhattacharya <suparna@in.ibm.com>
Subject: Re: [PATCH 4 of 7] Turn the DIO lock_type parameter into a flags field
Date: Thu, 2 Nov 2006 13:16:09 +1100 [thread overview]
Message-ID: <20061102021609.GS8394166@melbourne.sgi.com> (raw)
In-Reply-To: <20061102010225.GG31240@think.oraclecorp.com>
On Wed, Nov 01, 2006 at 08:02:25PM -0500, Chris Mason wrote:
> On Thu, Nov 02, 2006 at 09:58:58AM +1100, David Chinner wrote:
> [ ...]
>
> Thanks for the review, I'll incorporate these suggestions into the next
> patch set.
>
> > > +
> > > + /*
> > > + * the placeholder code does filemap_write_and_wait, so if we
> > > + * aren't using placeholders we have to do it here
> > > + */
> > > + if (!(dio->flags & DIO_PLACEHOLDERS) && end > offset) {
> > > + struct address_space *mapping = iocb->ki_filp->f_mapping;
> > > retval = filemap_write_and_wait_range(mapping, offset, end - 1);
> > > if (retval)
> > > goto out;
> >
> > So that means XFS will now do three cache flushes on write (one in
> > xfs_write(), one in generic_file_direct_IO() and yet another here....
>
> I removed the flush before starting the IO in generic_file_direct_IO
> because that is now done by the placeholders. When placeholders aren't
> used, we need the flush to match the old behavior.
OK - given that XFS does a flush-and-invalidate (with the i_mutex held)
before calling the generic direct I/O code, do we have grounds for another
flag here as it is not needed for XFS?
(FWIW, XFS's fs_flushinval_pages() could be made smarter now that we
have range based functions that can be used....)
> I added the flush in generic_file_direct_IO after calling the direct_IO
> func because invalidate_page_range2 requires the data to be flushed
> first. Otherwise it fails to free a dirty page with dirty buffers and
> spits out -EIO. This only happens when mapping->nrpages > 0, so it
> should be very low cost in the common case.
*nod*. XFS does it's flush-inval does on the same criteria.
> It's messy, I'll try to refactor things a bit to make it cleaner (same
> goes for i_mutex drop/lock).
True, but it is a lot less messy than the current code ;)
Cheers,
Dave.
--
Dave Chinner
Principal Engineer
SGI Australian Software Group
next prev parent reply other threads:[~2006-11-02 2:16 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-01 15:08 [PATCH 0 of 7] O_DIRECT locking rework Chris Mason
2006-11-01 15:08 ` [PATCH 1 of 7] Introduce a place holder page for the pagecache Chris Mason
2006-11-01 15:08 ` [PATCH 2 of 7] Change O_DIRECT to use placeholders instead of i_mutex/i_alloc_sem locking Chris Mason
2006-11-01 22:44 ` David Chinner
2006-11-01 15:08 ` [PATCH 3 of 7] DIO: don't fall back to buffered writes Chris Mason
2006-11-01 15:08 ` [PATCH 4 of 7] Turn the DIO lock_type parameter into a flags field Chris Mason
2006-11-01 22:58 ` David Chinner
2006-11-02 1:02 ` Chris Mason
2006-11-02 2:16 ` David Chinner [this message]
2006-11-08 18:48 ` Chris Mason
2006-11-01 15:08 ` [PATCH 5 of 7] Make ext3 safe for the new DIO locking rules Chris Mason
2006-11-01 15:08 ` [PATCH 6 of 7] Make reiserfs safe for " Chris Mason
2006-11-01 15:08 ` [PATCH 7 of 7] Adapt XFS to the new blockdev_direct_IO calls Chris Mason
2006-11-01 23:00 ` David Chinner
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=20061102021609.GS8394166@melbourne.sgi.com \
--to=dgc@sgi.com \
--cc=akpm@osdl.org \
--cc=chris.mason@oracle.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=suparna@in.ibm.com \
--cc=zach.brown@oracle.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.