linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris Mason <chris.mason@oracle.com>
To: David Chinner <dgc@sgi.com>
Cc: 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: Wed, 1 Nov 2006 20:02:25 -0500	[thread overview]
Message-ID: <20061102010225.GG31240@think.oraclecorp.com> (raw)
In-Reply-To: <20061101225858.GO8394166@melbourne.sgi.com>

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.

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.

It's messy, I'll try to refactor things a bit to make it cleaner (same
goes for i_mutex drop/lock).

-chris


  reply	other threads:[~2006-11-02  1:02 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 [this message]
2006-11-02  2:16       ` David Chinner
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=20061102010225.GG31240@think.oraclecorp.com \
    --to=chris.mason@oracle.com \
    --cc=akpm@osdl.org \
    --cc=dgc@sgi.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 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).