All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurence Oberman <loberman@redhat.com>
To: Bart Van Assche <bart.vanassche@wdc.com>,
	Mike Snitzer <snitzer@redhat.com>,
	 axboe@kernel.dk
Cc: linux-block@vger.kernel.org, dm-devel@redhat.com,
	linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org
Subject: Re: [dm-devel] [PATCH v5] blk-mq: introduce BLK_STS_DEV_RESOURCE
Date: Tue, 30 Jan 2018 13:38:44 -0500	[thread overview]
Message-ID: <1517337524.15224.0.camel@redhat.com> (raw)
In-Reply-To: <43ac2314-c98d-bb76-0dfb-171d15cc5fd8@wdc.com>

On Tue, 2018-01-30 at 09:52 -0800, Bart Van Assche wrote:
> On 01/30/18 06:24, Mike Snitzer wrote:
> > +		 *
> > +		 * If driver returns BLK_STS_RESOURCE and
> > SCHED_RESTART
> > +		 * bit is set, run queue after a delay to avoid IO
> > stalls
> > +		 * that could otherwise occur if the queue is
> > idle.
> >   		 */
> > -		if (!blk_mq_sched_needs_restart(hctx) ||
> > +		needs_restart = blk_mq_sched_needs_restart(hctx);
> > +		if (!needs_restart ||
> >   		    (no_tag && list_empty_careful(&hctx-
> > >dispatch_wait.entry)))
> >   			blk_mq_run_hw_queue(hctx, true);
> > +		else if (needs_restart && (ret ==
> > BLK_STS_RESOURCE))
> > +			blk_mq_delay_run_hw_queue(hctx,
> > BLK_MQ_QUEUE_DELAY);
> >   	}
> 
> If a request completes concurrently with execution of the above code 
> then the request completion will trigger a call of 
> blk_mq_sched_restart_hctx() and that call will clear the 
> BLK_MQ_S_SCHED_RESTART bit. If that bit is cleared before the above
> code 
> tests it then the above code will schedule an asynchronous call of 
> __blk_mq_run_hw_queue(). If the .queue_rq() call triggered by the
> new 
> queue run returns again BLK_STS_RESOURCE then the above code will be 
> executed again. In other words, a loop occurs. That loop will repeat
> as 
> long as the described race occurs. The current (kernel v4.15) block 
> layer behavior is simpler: only block drivers call 
> blk_mq_delay_run_hw_queue() and the block layer core never calls
> that 
> function. Hence that loop cannot occur with the v4.15 block layer
> core 
> and block drivers. A motivation of why that loop is preferred
> compared 
> to the current behavior (no loop) is missing. Does this mean that
> that 
> loop is a needless complication of the block layer core?
> 
> Sorry but I still prefer the v4.15 block layer approach because this 
> patch has in my view the following disadvantages:
> - It involves a blk-mq API change. API changes are always risky and
> need
>    some time to stabilize.
> - The delay after which to rerun the queue is moved from block layer
>    drivers into the block layer core. I think that's wrong because
> only
>    the block driver authors can make a good choice for this constant.
> - This patch makes block drivers harder to understand. Anyone who
> sees
>    return BLK_STS_RESOURCE / return BLK_STS_DEV_RESOURCE for the
> first
>    time will have to look up the meaning of these constants. An
> explicit
>    blk_mq_delay_run_hw_queue() call is easier to understand.
> - This patch makes the blk-mq core harder to understand because of
> the
>    loop mentioned above.
> - This patch does not fix any bugs nor makes block drivers easier to
>    read or to implement. So why is this patch considered useful?
> 
> Thanks,
> 
> Bart.

Hello Bart

What is the performance implication of your method versus this patch
above.
Is there more of a delay in your approach or in Ming's approach from
your own testing.
I guess it seems we will never get consensus on this so is it time to
take a vote. 

I respect and trust your inputs, you know that, but are you perhaps
prepared to accept the approach above and agree to it and if it turns
out to expose more issues it can be addressed later.

Is that not a better way to progress this because to me it looks like
you and Ming will continue to disagree on which is the better approach.

With much respect
Laurence

WARNING: multiple messages have this Message-ID (diff)
From: loberman@redhat.com (Laurence Oberman)
Subject: [dm-devel] [PATCH v5] blk-mq: introduce BLK_STS_DEV_RESOURCE
Date: Tue, 30 Jan 2018 13:38:44 -0500	[thread overview]
Message-ID: <1517337524.15224.0.camel@redhat.com> (raw)
In-Reply-To: <43ac2314-c98d-bb76-0dfb-171d15cc5fd8@wdc.com>

On Tue, 2018-01-30@09:52 -0800, Bart Van Assche wrote:
> On 01/30/18 06:24, Mike Snitzer wrote:
> > +		?*
> > +		?* If driver returns BLK_STS_RESOURCE and
> > SCHED_RESTART
> > +		?* bit is set, run queue after a delay to avoid IO
> > stalls
> > +		?* that could otherwise occur if the queue is
> > idle.
> > ??		?*/
> > -		if (!blk_mq_sched_needs_restart(hctx) ||
> > +		needs_restart = blk_mq_sched_needs_restart(hctx);
> > +		if (!needs_restart ||
> > ??		????(no_tag && list_empty_careful(&hctx-
> > >dispatch_wait.entry)))
> > ??			blk_mq_run_hw_queue(hctx, true);
> > +		else if (needs_restart && (ret ==
> > BLK_STS_RESOURCE))
> > +			blk_mq_delay_run_hw_queue(hctx,
> > BLK_MQ_QUEUE_DELAY);
> > ??	}
> 
> If a request completes concurrently with execution of the above code?
> then the request completion will trigger a call of?
> blk_mq_sched_restart_hctx() and that call will clear the?
> BLK_MQ_S_SCHED_RESTART bit. If that bit is cleared before the above
> code?
> tests it then the above code will schedule an asynchronous call of?
> __blk_mq_run_hw_queue(). If the .queue_rq() call triggered by the
> new?
> queue run returns again BLK_STS_RESOURCE then the above code will be?
> executed again. In other words, a loop occurs. That loop will repeat
> as?
> long as the described race occurs. The current (kernel v4.15) block?
> layer behavior is simpler: only block drivers call?
> blk_mq_delay_run_hw_queue() and the block layer core never calls
> that?
> function. Hence that loop cannot occur with the v4.15 block layer
> core?
> and block drivers. A motivation of why that loop is preferred
> compared?
> to the current behavior (no loop) is missing. Does this mean that
> that?
> loop is a needless complication of the block layer core?
> 
> Sorry but I still prefer the v4.15 block layer approach because this?
> patch has in my view the following disadvantages:
> - It involves a blk-mq API change. API changes are always risky and
> need
> ???some time to stabilize.
> - The delay after which to rerun the queue is moved from block layer
> ???drivers into the block layer core. I think that's wrong because
> only
> ???the block driver authors can make a good choice for this constant.
> - This patch makes block drivers harder to understand. Anyone who
> sees
> ???return BLK_STS_RESOURCE / return BLK_STS_DEV_RESOURCE for the
> first
> ???time will have to look up the meaning of these constants. An
> explicit
> ???blk_mq_delay_run_hw_queue() call is easier to understand.
> - This patch makes the blk-mq core harder to understand because of
> the
> ???loop mentioned above.
> - This patch does not fix any bugs nor makes block drivers easier to
> ???read or to implement. So why is this patch considered useful?
> 
> Thanks,
> 
> Bart.

Hello Bart

What is the performance implication of your method versus this patch
above.
Is there more of a delay in your approach or in Ming's approach from
your own testing.
I guess it seems we will never get consensus on this so is it time to
take a vote.?

I respect and trust your inputs, you know that, but are you perhaps
prepared to accept the approach above and agree to it and if it turns
out to expose more issues it can be addressed later.

Is that not a better way to progress this because to me it looks like
you and Ming will continue to disagree on which is the better approach.

With much respect
Laurence

  reply	other threads:[~2018-01-30 18:38 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-30 14:24 [PATCH v5] blk-mq: introduce BLK_STS_DEV_RESOURCE Mike Snitzer
2018-01-30 14:24 ` Mike Snitzer
2018-01-30 17:52 ` [dm-devel] " Bart Van Assche
2018-01-30 17:52   ` Bart Van Assche
2018-01-30 18:38   ` Laurence Oberman [this message]
2018-01-30 18:38     ` Laurence Oberman
2018-01-30 18:38     ` Laurence Oberman
2018-01-30 19:33   ` Mike Snitzer
2018-01-30 19:33     ` Mike Snitzer
2018-01-30 19:42     ` Bart Van Assche
2018-01-30 19:42       ` Bart Van Assche
2018-01-30 19:42       ` Bart Van Assche
2018-01-30 20:12       ` Mike Snitzer
2018-01-30 20:12         ` Mike Snitzer
2018-01-31  2:14   ` [dm-devel] " Ming Lei
2018-01-31  2:14     ` Ming Lei
2018-01-31  3:17   ` Jens Axboe
2018-01-31  3:17     ` Jens Axboe
2018-01-31  3:21     ` Bart Van Assche
2018-01-31  3:21       ` Bart Van Assche
2018-01-31  3:21       ` Bart Van Assche
2018-01-31  3:22       ` Jens Axboe
2018-01-31  3:22         ` Jens Axboe
2018-01-31  3:27         ` Bart Van Assche
2018-01-31  3:27           ` Bart Van Assche
2018-01-31  3:27           ` Bart Van Assche
2018-01-31  3:31           ` Jens Axboe
2018-01-31  3:31             ` Jens Axboe
2018-01-31  3:33         ` Ming Lei
2018-01-31  3:33           ` Ming Lei
2018-01-31  3:33           ` Ming Lei
2018-01-31  2:44 ` Jens Axboe
2018-01-31  2:44   ` Jens Axboe
2018-01-31  3:04   ` [PATCH v6] " Mike Snitzer
2018-01-31  3:04     ` Mike Snitzer
2018-01-31  3:18     ` Jens Axboe
2018-01-31  3:18       ` Jens Axboe
2018-01-31  3:07   ` [PATCH v5] " Mike Snitzer
2018-01-31  3:07     ` Mike Snitzer

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=1517337524.15224.0.camel@redhat.com \
    --to=loberman@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=bart.vanassche@wdc.com \
    --cc=dm-devel@redhat.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=snitzer@redhat.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 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.