All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Jeff Moyer <jmoyer@redhat.com>
Cc: linux-kernel@vger.kernel.org, Tejun Heo <tj@kernle.org>,
	Jens Axboe <jaxboe@fusionio.com>
Subject: Re: [patch] blk-flush: fix flush policy calculation
Date: Thu, 4 Aug 2011 12:16:24 +0200	[thread overview]
Message-ID: <20110804101624.GC2731@htj.dyndns.org> (raw)
In-Reply-To: <x49d3go98ku.fsf@segfault.boston.devel.redhat.com>

Hello,

On Mon, Aug 01, 2011 at 04:32:17PM -0400, Jeff Moyer wrote:
>         /*
>          * If there's data but flush is not necessary, the request can be
>          * processed directly without going through flush machinery.  Queue
>          * for normal execution.
>          */
>         if ((policy & REQ_FSEQ_DATA) &&
>             !(policy & (REQ_FSEQ_PREFLUSH | REQ_FSEQ_POSTFLUSH))) {
>                 list_add_tail(&rq->queuelist, &q->queue_head);
>                 return;
>         }
> 
> Given the code as it stands, I don't think the body of this if statement
> will ever be executed.

It does if the device has a WB cache and filesystem sends down a FUA
(but no FLUSH) request.

> I've attached a fix for this below.  It seems
> like this could be both a performance and a correctness issue, though
> I've not run into any problems I can directly attribute to this (perhaps
> due to file systems not issuing flushes when support is not advertised?).
> 
> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>

Hmmm... yes, this can become a correctness issue if (and only if)
blk_queue_flush() is called to change q->flush_flags while requests
are in-flight; otherwise, requests wouldn't reach the function at all.
Also, I think it would be a generally good idea to always set
FSEQ_DATA if the request has data.

 Acked-by: Tejun Heo <tj@kernel.org>

but can you please update the description?

Thank you.

-- 
tejun

      parent reply	other threads:[~2011-08-04 10:16 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-01 20:32 [patch] blk-flush: fix flush policy calculation Jeff Moyer
2011-08-02  1:20 ` Shaohua Li
2011-08-02 15:28   ` Jeff Moyer
2011-08-02 17:39   ` Jeff Moyer
2011-08-02 18:17     ` Vivek Goyal
2011-08-02 18:31       ` Jeff Moyer
2011-08-02 18:41         ` Vivek Goyal
2011-08-02 19:46           ` Jeff Moyer
2011-08-03  1:19             ` Shaohua Li
2011-08-09 17:13             ` Vivek Goyal
2011-08-09 17:29               ` Jeff Moyer
2011-08-02 18:40       ` Mike Snitzer
2011-08-04 10:20     ` Tejun Heo
2011-08-08 17:31       ` Jeff Moyer
2011-08-08 17:31       ` Jeff Moyer
2011-08-04 10:16 ` Tejun Heo [this message]

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=20110804101624.GC2731@htj.dyndns.org \
    --to=tj@kernel.org \
    --cc=jaxboe@fusionio.com \
    --cc=jmoyer@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tj@kernle.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.