linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lars Ellenberg <lars.ellenberg@linbit.com>
To: Tejun Heo <tj@kernel.org>
Cc: Philipp Reisner <philipp.reisner@linbit.com>,
	Jens Axboe <axboe@kernel.dk>,
	linux-kernel@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
	drbd-dev@lists.linbit.com
Subject: Re: [Drbd-dev] FLUSH/FUA documentation & code discrepancy
Date: Wed, 5 Sep 2012 12:07:24 +0200	[thread overview]
Message-ID: <20120905100724.GA27527@soda.linbit> (raw)
In-Reply-To: <20120905084915.GF3195@dhcp-172-17-108-109.mtv.corp.google.com>

On Wed, Sep 05, 2012 at 01:49:15AM -0700, Tejun Heo wrote:
> On Wed, Sep 05, 2012 at 10:44:55AM +0200, Philipp Reisner wrote:
> > > Currently, FLUSH/FUA doesn't enforce any ordering requirement.  File
> > > systems are responsible for draining all writes which have to happen
> > > before and not issue further writes which should come after.
> > 
> > Ok. That is a clear statement. So we will do it that way.
> > 
> > The "Currently" in you statement, suggests that there might be something
> > more mighty in the future. Is that true?
> 
> Heh, I was more thinking about the past.  We used to have barrier
> support with much stricter ordering.  I don't think we're gonna change
> the ordering requirement in any foreseeable future.

So reiterating the situation:

If I'd submit a non-empty bio with FLUSH/FUA set,
on a queue that does support flush, we get to
	blk_queue_bio()
		if (bio->bi_rw & (REQ_FLUSH | REQ_FUA)) {
			spin_lock_irq(q->queue_lock);
			where = ELEVATOR_INSERT_FLUSH;
			goto get_rq;

This bio ends up *not* being merged or reordered by the elevator.
(and, by means of flush/fua not by the hardware, either, obviously)


If the queue does not support it, flags are stripped away in
generic_make_request_checks(), and we will not take that branch
in blk_queue_bio(), but enter the normal elevator code path,
attempting a merge, or doing ELEVATOR_INSERT_SORT.

This same bio, happening to be submitted on a different IO stack,
now *is* being reordered in the elevator already,
even before being sent to the hardware.




If we somehow can express at submit_bio time that we would like
this bio, once it reaches the elevator, to not be reordered,
regardless of whether or not FLUSH is supported respectively required
by the IO stack in use, that would be better than now, IMO.
In fact, for our particular use case it would even be good enough.


Could we "just" strip these flags a "little bit later"?
Or set some other indicator when stripping them?


Thanks,

	Lars


  reply	other threads:[~2012-09-05 10:07 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-04 12:32 FLUSH/FUA documentation & code discrepancy Philipp Reisner
2012-09-04 22:46 ` Tejun Heo
2012-09-05  8:44   ` [Drbd-dev] " Philipp Reisner
2012-09-05  8:49     ` Tejun Heo
2012-09-05 10:07       ` Lars Ellenberg [this message]
2012-09-06 21:29         ` Tejun Heo
2012-09-07  8:42           ` Lars Ellenberg
2012-09-10 22:54             ` Tejun Heo
2012-09-10 23:06               ` Tejun Heo
2012-09-10 23:12                 ` Kent Overstreet
2012-09-10 23:31                 ` Kent Overstreet
2012-09-11  5:58                   ` NeilBrown
2012-09-11  8:25                     ` Lars Ellenberg
2012-09-11 14:41                       ` Vivek Goyal
2012-09-12 18:58                       ` Tejun Heo
2012-09-12 23:12                         ` Joseph Glanville
2012-09-12 23:20                           ` Tejun Heo
2012-09-12 23:53                             ` Joseph Glanville
2012-09-13  0:17                               ` Joseph Glanville
2012-09-13  3:10                                 ` Joseph Glanville
2012-09-13 19:25                                   ` Tejun Heo
2012-09-11 14:34                 ` 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=20120905100724.GA27527@soda.linbit \
    --to=lars.ellenberg@linbit.com \
    --cc=axboe@kernel.dk \
    --cc=drbd-dev@lists.linbit.com \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=philipp.reisner@linbit.com \
    --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).