From: Vivek Goyal <vgoyal@redhat.com>
To: Alex Bligh <alex@alex.org.uk>
Cc: linux-fsdevel@vger.kernel.org, Tejun Heo <tj@kernel.org>
Subject: Re: Questions on block drivers, REQ_FLUSH and REQ_FUA
Date: Tue, 24 May 2011 18:37:28 -0400 [thread overview]
Message-ID: <20110524223728.GB379@redhat.com> (raw)
In-Reply-To: <20110524223220.GA379@redhat.com>
On Tue, May 24, 2011 at 06:32:20PM -0400, Vivek Goyal wrote:
> On Tue, May 24, 2011 at 10:29:09PM +0100, Alex Bligh wrote:
>
> [..]
> > Q3: Apparently there are no longer concepts of barriers, just REQ_FLUSH
> > and REQ_FUA. REQ_FLUSH guarantees all "completed" I/O requests are written
> > to disk prior to that BIO starting. However, what about non-completed I/O
> > requests? For instance, is the following legitimate:
> >
> > Receive Send to disk Reply
> > ======= ============ =====
> > WRITE1
> > WRITE2
> > WRITE2 (cached)
> > FLUSH+WRITE3
> > WRITE2
> > WRITE3
> > WRITE3
> > WRITE4
> > WRITE4
> > WRITE4
> > WRITE1
> > WRITE1
> >
> > Here WRITE1 was not 'completed', and thus by the text of
> > Documentation/writeback_cache_control.txt, need not be written to disk
> > before starting WRITE3 (which had REQ_FLUSH attached).
> >
> > >The REQ_FLUSH flag can be OR ed into the r/w flags of a bio submitted from
> > >the filesystem and will make sure the volatile cache of the storage device
> > >has been flushed before the actual I/O operation is started. This
> > >explicitly guarantees that previously completed write requests are on
> > >non-volatile storage before the flagged bio starts.
Are you writing a bio based driver? For a request based driver request
queue should break down FLUSH + WRITE3 request in two parts. Issue FLUSH
first and when that completes, issue WRITE3.
Thanks
Vivek
next prev parent reply other threads:[~2011-05-24 22:37 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-24 21:29 Questions on block drivers, REQ_FLUSH and REQ_FUA Alex Bligh
2011-05-24 22:32 ` Vivek Goyal
2011-05-24 22:37 ` Vivek Goyal [this message]
2011-05-25 8:06 ` Alex Bligh
2011-05-25 8:59 ` Tejun Heo
2011-05-25 15:54 ` Alex Bligh
2011-05-25 16:43 ` Tejun Heo
2011-05-25 17:43 ` Alex Bligh
2011-05-25 19:10 ` Vivek Goyal
2011-05-25 19:58 ` Alex Bligh
2011-05-25 19:15 ` Vivek Goyal
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=20110524223728.GB379@redhat.com \
--to=vgoyal@redhat.com \
--cc=alex@alex.org.uk \
--cc=linux-fsdevel@vger.kernel.org \
--cc=tj@kernel.org \
/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).