From: Christoph Hellwig <hch@infradead.org>
To: David Chinner <dgc@sgi.com>
Cc: Neil Brown <neilb@suse.de>, xfs@oss.sgi.com, hch@infradead.org
Subject: Re: XFS and write barriers.
Date: Fri, 23 Mar 2007 09:50:55 +0000 [thread overview]
Message-ID: <20070323095055.GA13478@infradead.org> (raw)
In-Reply-To: <20070323053043.GD32602149@melbourne.sgi.com>
On Fri, Mar 23, 2007 at 04:30:43PM +1100, David Chinner wrote:
> On Fri, Mar 23, 2007 at 12:26:31PM +1100, Neil Brown wrote:
> >
> > Hi,
> > I have two concerns related to XFS and write barrier support that I'm
> > hoping can be resolved.
> >
> > Firstly in xfs_mountfs_check_barriers in fs/xfs/linux-2.6/xfs_super.c,
> > it tests ....->queue->ordered to see if that is QUEUE_ORDERED_NONE.
> > If it is, then barriers are disabled.
> >
> > I think this is a layering violation - xfs really has no business
> > looking that deeply into the device.
>
> Except that the device behaviour determines what XFS needs to do
> and there used to be no other way to find out.
>
> Christoph, any reason for needing this check anymore? I can't see
> any particular reason for needing to do this as __make_request()
> will check it for us when we test now.
When I first implemented it I really dislike the idea of having request
fail asynchrnously due to the lack of barriers. Then someone (Jens?)
told me we need to do this check anyway because devices might lie to
us, at which point I implemented the test superblock writeback to
check if it actually works.
So yes, we could probably get rid of the check now, although I'd
prefer the block layer exporting an API to the filesystem to tell
it whether there is any point in trying to use barriers.
> > Secondly, if a barrier write fails due to EOPNOTSUPP, it should be
> > retried without the barrier (after possibly waiting for dependant
> > requests to complete). This is what other filesystems do, but I
> > cannot find the code in xfs which does this.
>
> XFS doesn't handle this - I was unaware that the barrier status of the
> underlying block device could change....
>
> OOC, when did this behaviour get introduced?
That would be really bad. XFS metadata buffers can have multiple bios
and retrying a single one would be rather difficult.
> + /*
> + * We can get an EOPNOTSUPP to ordered writes. Here we clear the
> + * ordered flag and reissue them. Because we can't tell the higher
> + * layers directly that they should not issue ordered I/O anymore, they
> + * need to check if the ordered flag was cleared during I/O completion.
> + */
> + if ((bp->b_error == EOPNOTSUPP) &&
> + (bp->b_flags & (XBF_ORDERED|XBF_ASYNC)) == (XBF_ORDERED|XBF_ASYNC)) {
> + XB_TRACE(bp, "ordered_retry", bp->b_iodone);
> + bp->b_flags &= ~XBF_ORDERED;
> + xfs_buf_iorequest(bp);
> + } else if (bp->b_iodone)
> (*(bp->b_iodone))(bp);
> else if (bp->b_flags & XBF_ASYNC)
> xfs_buf_relse(bp);
So you're retrying the whole I/O, this is probably better than trying
to handle this at the bio level. I still don't quite like doing another
I/O from the I/O completion handler.
next prev parent reply other threads:[~2007-03-23 10:12 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-23 1:26 XFS and write barriers Neil Brown
2007-03-23 5:30 ` David Chinner
2007-03-23 7:49 ` Neil Brown
2007-03-25 4:17 ` David Chinner
2007-03-25 23:21 ` Neil Brown
2007-03-26 3:14 ` David Chinner
2007-03-26 4:27 ` Neil Brown
2007-03-26 9:04 ` David Chinner
2007-03-29 14:56 ` Martin Steigerwald
2007-03-29 15:18 ` David Chinner
2007-03-29 16:49 ` Martin Steigerwald
2007-03-23 9:50 ` Christoph Hellwig [this message]
2007-03-25 3:51 ` David Chinner
2007-03-25 23:58 ` Neil Brown
2007-03-26 1:11 ` Neil Brown
2007-03-23 6:20 ` Timothy Shimmin
2007-03-23 8:00 ` Neil Brown
2007-03-25 3:19 ` David Chinner
2007-03-26 0:01 ` Neil Brown
2007-03-26 3:58 ` David Chinner
2007-03-27 3:58 ` Timothy Shimmin
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=20070323095055.GA13478@infradead.org \
--to=hch@infradead.org \
--cc=dgc@sgi.com \
--cc=neilb@suse.de \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox