All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Mike Snitzer <snitzer@redhat.com>
Cc: linux-block@vger.kernel.org, dm-devel@redhat.com,
	linux-scsi@vger.kernel.org, linux-nvme@lists.infradead.org
Subject: Re: [PATCH v6] blk-mq: introduce BLK_STS_DEV_RESOURCE
Date: Tue, 30 Jan 2018 20:18:54 -0700	[thread overview]
Message-ID: <729b1ba5-84ee-2c65-9c94-fbeba27b90d4@kernel.dk> (raw)
In-Reply-To: <20180131030457.1132-1-snitzer@redhat.com>

On 1/30/18 8:04 PM, Mike Snitzer wrote:
> From: Ming Lei <ming.lei@redhat.com>
> 
> This status is returned from driver to block layer if device related
> resource is unavailable, but driver can guarantee that IO dispatch
> will be triggered in future when the resource is available.
> 
> Convert some drivers to return BLK_STS_DEV_RESOURCE.  Also, if driver
> returns BLK_STS_RESOURCE and SCHED_RESTART is set, rerun queue after
> a delay (BLK_MQ_DELAY_QUEUE) to avoid IO stalls.  BLK_MQ_DELAY_QUEUE is
> 3 ms because both scsi-mq and nvmefc are using that magic value.
> 
> If a driver can make sure there is in-flight IO, it is safe to return
> BLK_STS_DEV_RESOURCE because:
> 
> 1) If all in-flight IOs complete before examining SCHED_RESTART in
> blk_mq_dispatch_rq_list(), SCHED_RESTART must be cleared, so queue
> is run immediately in this case by blk_mq_dispatch_rq_list();
> 
> 2) if there is any in-flight IO after/when examining SCHED_RESTART
> in blk_mq_dispatch_rq_list():
> - if SCHED_RESTART isn't set, queue is run immediately as handled in 1)
> - otherwise, this request will be dispatched after any in-flight IO is
>   completed via blk_mq_sched_restart()
> 
> 3) if SCHED_RESTART is set concurently in context because of
> BLK_STS_RESOURCE, blk_mq_delay_run_hw_queue() will cover the above two
> cases and make sure IO hang can be avoided.
> 
> One invariant is that queue will be rerun if SCHED_RESTART is set.

Applied, thanks.

-- 
Jens Axboe

WARNING: multiple messages have this Message-ID (diff)
From: axboe@kernel.dk (Jens Axboe)
Subject: [PATCH v6] blk-mq: introduce BLK_STS_DEV_RESOURCE
Date: Tue, 30 Jan 2018 20:18:54 -0700	[thread overview]
Message-ID: <729b1ba5-84ee-2c65-9c94-fbeba27b90d4@kernel.dk> (raw)
In-Reply-To: <20180131030457.1132-1-snitzer@redhat.com>

On 1/30/18 8:04 PM, Mike Snitzer wrote:
> From: Ming Lei <ming.lei at redhat.com>
> 
> This status is returned from driver to block layer if device related
> resource is unavailable, but driver can guarantee that IO dispatch
> will be triggered in future when the resource is available.
> 
> Convert some drivers to return BLK_STS_DEV_RESOURCE.  Also, if driver
> returns BLK_STS_RESOURCE and SCHED_RESTART is set, rerun queue after
> a delay (BLK_MQ_DELAY_QUEUE) to avoid IO stalls.  BLK_MQ_DELAY_QUEUE is
> 3 ms because both scsi-mq and nvmefc are using that magic value.
> 
> If a driver can make sure there is in-flight IO, it is safe to return
> BLK_STS_DEV_RESOURCE because:
> 
> 1) If all in-flight IOs complete before examining SCHED_RESTART in
> blk_mq_dispatch_rq_list(), SCHED_RESTART must be cleared, so queue
> is run immediately in this case by blk_mq_dispatch_rq_list();
> 
> 2) if there is any in-flight IO after/when examining SCHED_RESTART
> in blk_mq_dispatch_rq_list():
> - if SCHED_RESTART isn't set, queue is run immediately as handled in 1)
> - otherwise, this request will be dispatched after any in-flight IO is
>   completed via blk_mq_sched_restart()
> 
> 3) if SCHED_RESTART is set concurently in context because of
> BLK_STS_RESOURCE, blk_mq_delay_run_hw_queue() will cover the above two
> cases and make sure IO hang can be avoided.
> 
> One invariant is that queue will be rerun if SCHED_RESTART is set.

Applied, thanks.

-- 
Jens Axboe

  reply	other threads:[~2018-01-31  3:18 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
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 [this message]
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=729b1ba5-84ee-2c65-9c94-fbeba27b90d4@kernel.dk \
    --to=axboe@kernel.dk \
    --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.