mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jeff Moyer <jmoyer@redhat.com>
To: Tejun Heo <tj@kernel.org>
Cc: Jens Axboe <jaxboe@fusionio.com>, shaohua <shli@kernel.org>,
	Vivek Goyal <vgoyal@in.ibm.com>,
	dm-devel@redhat.com, linux-kernel@vger.kernel.org,
	Mike Snitzer <msnitzer@redhat.com>
Subject: Re: [patch,v2] block: fix flush machinery for stacking drivers with differring flush flags
Date: Mon, 15 Aug 2011 11:12:03 -0400	[thread overview]
Message-ID: <x49zkja7lq4.fsf@segfault.boston.devel.redhat.com> (raw)
In-Reply-To: <20110813132910.GB4254@htj.dyndns.org> (Tejun Heo's message of "Sat, 13 Aug 2011 15:29:10 +0200")

Tejun Heo <tj@kernel.org> writes:

> Hello,
>
> On Fri, Aug 12, 2011 at 03:07:51PM -0400, Jeff Moyer wrote:
>> Changes from v1->v2:
>> - Moved the detection of empty flush requests into blk_insert_flush.
>> - Got rid of REQ_FLUSH_SEQ in the CLONE_FLAGS.
>
> Heh yeah, this looks pretty good to me. :)
>
>> @@ -312,6 +309,19 @@ void blk_insert_flush(struct request *rq)
>>  		rq->cmd_flags &= ~REQ_FUA;
>>  
>>  	/*
>> +	 * An empty flush handed down from a stacking driver may
>> +	 * translate into nothing if the underlying device does not
>> +	 * advertise a write-back cache.  In this case, simply
>> +	 * complete the request.
>> +	 */
>> +	if (!policy && !blk_rq_bytes(rq)) {
>> +		__blk_end_bidi_request(rq, 0, 0, 0);
>> +		return;
>> +	}
>
> Hmmm... doesn't !policy imply !blk_rq_bytes() with your change just
> merged to Jens' tree?

Yes, I'll fix that up.

>> @@ -319,6 +329,7 @@ void blk_insert_flush(struct request *rq)
>>  	if ((policy & REQ_FSEQ_DATA) &&
>>  	    !(policy & (REQ_FSEQ_PREFLUSH | REQ_FSEQ_POSTFLUSH))) {
>>  		list_add_tail(&rq->queuelist, &q->queue_head);
>> +		blk_run_queue_async(q);
>>  		return;
>>  	}
>
> In the other message, you said,
>
>> Well, the only time we need to run the queue is when the request has
>> data, has REQ_FUA set, and the underlying queue's flush flags contain
>> only REQ_FUA.  In code:
>> 
>> if (rq->cmd_flags & REQ_FUA && q->flush_flags == REQ_FUA)
>>        blk_run_queue_async(q);
>
> But this can't happen because a queue can't have REQ_FUA without
> REQ_FLUSH (it doesn't make any sense).  blk_queue_flush() will trigger
> WARN_ON_ONCE() and turn off REQ_FUA in such cases.

I confused REQ_FSEQ_DATA with REQ_FUA.  The bottom line is that the
logic in blk_insert_flush would have to be duplicated in
blk_insert_cloned_request in order to move the queue kick up the call
stack.  I don't think that's a clean way to do things.

> That said, it's kinda unclear who should be responsible for kicking
> the queue.  __elv_add_request() does it for some but not all.
> __make_request() always activates the queue which sometimes ends up
> doing it again after __elv_add_request().  I think kicking the queue
> after short circuit insert probably is the right thing to do.

OK.  I'll post a follow-up with that one fix above.  Hopefully that will
do it.  ;-)

Cheers,
Jeff

      reply	other threads:[~2011-08-15 15:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-12 19:07 Jeff Moyer
2011-08-13 13:29 ` Tejun Heo
2011-08-15 15:12   ` Jeff Moyer [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=x49zkja7lq4.fsf@segfault.boston.devel.redhat.com \
    --to=jmoyer@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=jaxboe@fusionio.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=msnitzer@redhat.com \
    --cc=shli@kernel.org \
    --cc=tj@kernel.org \
    --cc=vgoyal@in.ibm.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

all inboxes | Powered by JetHome®