From: Martin Steigerwald <Martin@lichtvoll.de>
To: linux-xfs@oss.sgi.com
Subject: Re: XFS and write barrier
Date: Sat, 22 Jul 2006 11:31:15 +0200 [thread overview]
Message-ID: <200607221131.16238.Martin@lichtvoll.de> (raw)
In-Reply-To: <20060718192135.GV15160733@melbourne.sgi.com>
Am Dienstag 18 Juli 2006 21:21 schrieb David Chinner:
> > > blkdev_issue_flush() causes a write cache flush - just like a
> > > barrier typically causes a write cache flush up to the I/O with the
> > > barrier in it. Both of these mechanisms provide the same thing -
> > > an I/O barrier that enforces ordering of I/Os to disk.
> >
> > Hello David,
> >
> > well now it gets interesting. If both provide the same thing, whats
> > the difference?
>
> A WRITE_BARRIER I/O can be optimised by smart drivers, protocols and
> hardware to minimise the adverse effects of the barrier, whereas a
> cache flush is a brute force cache cleaning mechanism that cannot be
> optimised....
Hello David,
I like to understand this difference a bit better.
As far as I understand there are three important differences between
blkdev_issue_flush() and using the new barrier functionality:
1) blkdev_issue_flush() issues a cache flush synchronously and the
filesystem has to wait for it to return. OTOH a write barrier is like a
asynchron cache flush: The filesystem sends a barrier request to the
block layer and forgets about it then. It can handle other stuff in the
meanwhile while block layer will take care of the correct order of the
write requests.
2) Since the filesystem offloads the ordering of the requests to the block
layer, block layer can support smart drivers, protocols and hardware to
optimize request ordering (say TCQ devices for example).
3) A direct cache flush means that the cache flush has to happen
immediately while with a barrier it can happen some time in the future
given that it happens before the barrier request is issued.
So the advantages of the barrier functionality that is that it provides
request ordering at a lower cost for the filesystem.
Anything to add or correct?
Regards,
--
Martin 'Helios' Steigerwald - http://www.Lichtvoll.de
GPG: 03B0 0D6C 0040 0710 4AFA B82F 991B EAAC A599 84C7
next prev parent reply other threads:[~2006-07-22 9:32 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-15 10:48 XFS and write barrier Martin Steigerwald
2006-07-15 19:28 ` Chris Wedgwood
2006-07-16 9:53 ` Martin Steigerwald
2006-07-17 0:43 ` Chris Wedgwood
2006-07-17 1:24 ` Chris Wedgwood
2006-07-16 17:32 ` Federico Sevilla III
2006-07-18 7:31 ` Nathan Scott
2006-07-18 8:58 ` Neil Brown
2006-07-18 17:04 ` David Chinner
2006-07-18 18:27 ` Martin Steigerwald
2006-07-18 19:21 ` David Chinner
2006-07-20 10:34 ` Martin Steigerwald
2006-07-22 9:31 ` Martin Steigerwald [this message]
2006-07-22 10:36 ` Stefan Smietanowski
2006-07-18 23:41 ` Neil Brown
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=200607221131.16238.Martin@lichtvoll.de \
--to=martin@lichtvoll.de \
--cc=linux-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