From: Ming Lei <ming.lei@redhat.com>
To: Bart Van Assche <bvanassche@acm.org>
Cc: Jens Axboe <axboe@kernel.dk>,
linux-block@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
linux-nvme@lists.infradead.org
Subject: Re: [PATCH 1/2] blk-mq: introduce blk_mq_complete_request_sync()
Date: Mon, 18 Mar 2019 23:16:19 +0800 [thread overview]
Message-ID: <20190318151618.GA20371@ming.t460p> (raw)
In-Reply-To: <1552921495.152266.8.camel@acm.org>
On Mon, Mar 18, 2019 at 08:04:55AM -0700, Bart Van Assche wrote:
> On Mon, 2019-03-18 at 15:38 +0800, Ming Lei wrote:
> > On Sun, Mar 17, 2019 at 09:09:09PM -0700, Bart Van Assche wrote:
> > > On 3/17/19 8:29 PM, Ming Lei wrote:
> > > > In NVMe's error handler, follows the typical steps for tearing down
> > > > hardware:
> > > >
> > > > 1) stop blk_mq hw queues
> > > > 2) stop the real hw queues
> > > > 3) cancel in-flight requests via
> > > > blk_mq_tagset_busy_iter(tags, cancel_request, ...)
> > > > cancel_request():
> > > > mark the request as abort
> > > > blk_mq_complete_request(req);
> > > > 4) destroy real hw queues
> > > >
> > > > However, there may be race between #3 and #4, because blk_mq_complete_request()
> > > > actually completes the request asynchronously.
> > > >
> > > > This patch introduces blk_mq_complete_request_sync() for fixing the
> > > > above race.
> > >
> > > Other block drivers wait until outstanding requests have completed by
> > > calling blk_cleanup_queue() before hardware queues are destroyed. Why can't
> > > the NVMe driver follow that approach?
> >
> > The tearing down of controller can be done in error handler, in which
> > the request queues may not be cleaned up, almost all kinds of NVMe
> > controller's error handling follows the above steps, such as:
> >
> > nvme_rdma_error_recovery_work()
> > ->nvme_rdma_teardown_io_queues()
> >
> > nvme_timeout()
> > ->nvme_dev_disable
>
> Hi Ming,
>
> This makes me wonder whether the current design of the NVMe core is the best
> design we can come up with? The structure of e.g. the SRP initiator and target
> drivers is similar to the NVMeOF drivers. However, there is no need in the SRP
> initiator driver to terminate requests synchronously. Is this due to
I am not familiar with SRP, could you explain what SRP initiator driver
will do when the controller is in bad state? Especially about dealing with
in-flight IO requests under this situation.
> differences in the error handling approaches in the SCSI and NVMe core drivers?
As far as I can tell, I don't see obvious design issue in NVMe host drivers,
which tries best to recover controller and retries to complete all in-flight IO.
Thanks,
Ming
next prev parent reply other threads:[~2019-03-18 15:16 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-18 3:29 [PATCH 0/2] blk-mq/nvme: cancel request synchronously Ming Lei
2019-03-18 3:29 ` [PATCH 1/2] blk-mq: introduce blk_mq_complete_request_sync() Ming Lei
2019-03-18 4:09 ` Bart Van Assche
2019-03-18 7:38 ` Ming Lei
2019-03-18 15:04 ` Bart Van Assche
2019-03-18 15:16 ` Ming Lei [this message]
2019-03-18 15:49 ` Bart Van Assche
2019-03-18 16:06 ` Ming Lei
2019-03-21 0:47 ` Sagi Grimberg
2019-03-21 1:39 ` Ming Lei
2019-03-21 2:04 ` Sagi Grimberg
2019-03-21 2:32 ` Ming Lei
2019-03-21 21:40 ` Sagi Grimberg
2019-03-27 8:27 ` Christoph Hellwig
2019-03-21 2:15 ` Bart Van Assche
2019-03-21 2:13 ` Sagi Grimberg
2019-03-18 14:40 ` Keith Busch
2019-03-18 17:30 ` James Smart
2019-03-18 17:37 ` James Smart
2019-03-19 1:06 ` Ming Lei
2019-03-19 3:37 ` James Smart
2019-03-19 3:50 ` Ming Lei
2019-03-19 1:31 ` Ming Lei
2019-03-19 4:04 ` James Smart
2019-03-19 4:28 ` Ming Lei
2019-03-27 8:30 ` Christoph Hellwig
2019-03-18 3:29 ` [PATCH 2/2] nvme: cancel request synchronously Ming Lei
2019-03-27 8:30 ` Christoph Hellwig
2019-03-27 2:06 ` [PATCH 0/2] blk-mq/nvme: " Ming Lei
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=20190318151618.GA20371@ming.t460p \
--to=ming.lei@redhat.com \
--cc=axboe@kernel.dk \
--cc=bvanassche@acm.org \
--cc=hch@lst.de \
--cc=linux-block@vger.kernel.org \
--cc=linux-nvme@lists.infradead.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).