mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alex Bligh <alex@alex.org.uk>
To: linux-kernel@vger.kernel.org, Jan Kara <jack@suse.cz>
Cc: Alex Bligh <alex@alex.org.uk>
Subject: Question: block layer and REQ_FLUSH
Date: Tue, 24 May 2011 13:19:05 +0100	[thread overview]
Message-ID: <4C9FE036825E46DE8121365F@Ximines.local> (raw)

Documentation/block/writeback_cache_control.txt says:

> 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.

>From the block driver's point of view, is it only necessary to ensure
*completed* I/O operations are flushed to disk (as per the text), or
is it also necessary to ensure *in flight* requests (i.e. those that
have not been completed) are flushed to disk too? IE when the block
layer does the flush, does it also wait for in-flight I/O to complete?

IE if the time sequence is
	WRITE1
	WRITE2
	WRITE3
			Complete WRITE2 -> sent to volatile cache
	WRITE4
	REQ_FLUSH

Do I need to only ensure WRITE2 is flushed, or (as I suspect) do I
need to wait for all bios previously submitted to the driver to
complete? If so, from the driver's point of view anyway, should the
guarantee refer to "previously submitted write requests" as opposed
to "previously completed"?

-- 
Alex Bligh

                 reply	other threads:[~2011-05-24 12:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=4C9FE036825E46DE8121365F@Ximines.local \
    --to=alex@alex.org.uk \
    --cc=jack@suse.cz \
    --cc=linux-kernel@vger.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

all inboxes | Powered by JetHome®