From: Alex Elder <aelder@sgi.com>
To: Dave Chinner <david@fromorbit.com>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 5/8] xfs: split direct IO write path from xfs_file_aio_write
Date: Tue, 04 Jan 2011 19:54:55 -0600 [thread overview]
Message-ID: <1294192495.2485.726.camel@doink> (raw)
In-Reply-To: <1294116518-14908-6-git-send-email-david@fromorbit.com>
On Tue, 2011-01-04 at 15:48 +1100, Dave Chinner wrote:
> From: Dave Chinner <dchinner@redhat.com>
>
> The current xfs_file_aio_write code is a mess of locking shenanigans
> to handle the different locking requirements of buffered and direct
> IO. Start to clean this up by disentangling the direct IO path from
> the mess.
All good, very good. But I'm not sure why you cut
out the code that backed off to buffered I/O if
generic_file_direct_write() returns an error.
(You gave no explanation.)
-Alex
> Signed-off-by: Dave Chinner <dchinner@redhat.com>
> ---
> fs/xfs/linux-2.6/xfs_file.c | 168 ++++++++++++++++++++++++++++---------------
> 1 files changed, 110 insertions(+), 58 deletions(-)
>
> diff --git a/fs/xfs/linux-2.6/xfs_file.c b/fs/xfs/linux-2.6/xfs_file.c
> index 0d6111e..d546953 100644
> --- a/fs/xfs/linux-2.6/xfs_file.c
> +++ b/fs/xfs/linux-2.6/xfs_file.c
> @@ -619,6 +619,110 @@ out_lock:
> return error;
> }
>
> +/*
> + * xfs_file_dio_aio_write - handle direct IO writes
> + *
> + * Lock the inode appropriately to prepare for and issue a direct IO write.
> + * By spearating it from the buffered write path we remove all the tricky to
separating
> + * follow locking changes and looping. This also clearly indicates that XFS
> + * does not fall back to buffered IO in the direct IO write path.
> + *
> + * Returns with locks held indicated by @iolock and errors indicated by
> + * negative return values.
> + */
> +STATIC ssize_t
> +xfs_file_dio_aio_write(
> + struct kiocb *iocb,
> + const struct iovec *iovp,
. . .
> + trace_xfs_file_direct_write(ip, count, iocb->ki_pos, 0);
> + ret = generic_file_direct_write(iocb, iovp,
> + &nr_segs, pos, &iocb->ki_pos, count, ocount);
> +
> + /* No fallback to buffered IO on errors for XFS. */
Why is this? The previous code did fall back (so this change
is doing more than just splitting out the direct I/O path).
> + return ret;
> +}
> +
> STATIC ssize_t
> xfs_file_aio_write(
> struct kiocb *iocb,
. . .
> @@ -788,6 +839,7 @@ write_retry:
>
> current->backing_dev_info = NULL;
>
> +done_io:
> xfs_aio_write_isize_update(inode, &iocb->ki_pos, ret);
>
> if (ret <= 0)
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2011-01-05 1:52 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-04 4:48 [PATCH 0/8] xfs: prevent corruption due to overlapping AIO DIO V2 Dave Chinner
2011-01-04 4:48 ` [PATCH 1/8] xfs: ensure sync write errors are returned Dave Chinner
2011-01-05 1:53 ` Alex Elder
2011-01-07 8:45 ` Christoph Hellwig
2011-01-07 9:07 ` Dave Chinner
2011-01-04 4:48 ` [PATCH 2/8] xfs: factor common post-write isize handling code Dave Chinner
2011-01-05 1:54 ` Alex Elder
2011-01-04 4:48 ` [PATCH 4/8] xfs: introduce xfs_rw_lock() helpers for locking the inode Dave Chinner
2011-01-05 1:54 ` Alex Elder
2011-01-05 7:55 ` Dave Chinner
2011-01-04 4:48 ` [PATCH 5/8] xfs: split direct IO write path from xfs_file_aio_write Dave Chinner
2011-01-05 1:54 ` Alex Elder [this message]
2011-01-05 7:36 ` Dave Chinner
2011-01-07 8:58 ` Christoph Hellwig
2011-01-07 9:21 ` Dave Chinner
2011-01-04 4:48 ` [PATCH 6/8] xfs: split buffered " Dave Chinner
2011-01-05 1:55 ` Alex Elder
2011-01-04 4:48 ` [PATCH 7/8] xfs: factor common write setup code Dave Chinner
2011-01-05 1:55 ` Alex Elder
2011-01-07 8:53 ` Christoph Hellwig
2011-01-07 9:20 ` Dave Chinner
2011-01-04 4:48 ` [PATCH 8/8] xfs: serialise unaligned direct IOs Dave Chinner
2011-01-05 1:55 ` Alex Elder
2011-01-05 1:53 ` [PATCH 0/8] xfs: prevent corruption due to overlapping AIO DIO V2 Alex Elder
-- strict thread matches above, loose matches on Subject: below --
2011-01-07 11:30 [PATCH 0/8] xfs: prevent corruption due to overlapping AIO DIO V3 Dave Chinner
2011-01-07 11:30 ` [PATCH 5/8] xfs: split direct IO write path from xfs_file_aio_write Dave Chinner
2011-01-10 19:24 ` Christoph Hellwig
2011-01-10 23:37 [PATCH 0/8] xfs: prevent corruption due to overlapping AIO DIO V4 Dave Chinner
2011-01-10 23:37 ` [PATCH 5/8] xfs: split direct IO write path from xfs_file_aio_write Dave Chinner
2011-01-11 21:44 ` Alex Elder
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=1294192495.2485.726.camel@doink \
--to=aelder@sgi.com \
--cc=david@fromorbit.com \
--cc=xfs@oss.sgi.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.