From: keith.busch@intel.com (Keith Busch)
Subject: [PATCH 1/2] NVMe: Make surprise removal work again
Date: Tue, 26 Jan 2016 23:59:22 +0000 [thread overview]
Message-ID: <20160126235922.GB18103@localhost.localdomain> (raw)
In-Reply-To: <20160126165334.GB609@infradead.org>
On Tue, Jan 26, 2016@08:53:34AM -0800, Christoph Hellwig wrote:
> > if (kill) {
> > blk_set_queue_dying(ns->queue);
> > + mb();
>
> Please always comment memory barriers, I can't really make any sense
> of this one.
I meant to remove this before posting. It was for an error I thought
occured when testing the patch, but didn't confirm: did a h/w queue
restart and not see the dying flag in nvme_queue_rq? I don't think that's
what happened, but left that in by mistake.
I'll respin.
> > blk_mq_abort_requeue_list(ns->queue);
> > + __nvme_start_queue_locked(ns);
>
> Also why do we need a kick of the requeue list above if we just aborted
> all requests on it?
Just reusing existing code. We don't need to abort the requeue list
first. It's just a short cut to ending commands.
I don't think the queue restarting was necessary before since requests
used to wait on a frozen queue before failing. Now they wait on tags,
so need some way to flush them to failure.
> > +++ b/drivers/nvme/host/pci.c
> > @@ -640,6 +640,10 @@ static int nvme_queue_rq(struct blk_mq_hw_ctx *hctx,
> > struct nvme_command cmnd;
> > int ret = BLK_MQ_RQ_QUEUE_OK;
> >
> > + if (unlikely(blk_queue_dying(req->q))) {
> > + blk_mq_end_request(req, -EIO);
> > + return BLK_MQ_RQ_QUEUE_OK;
> > + }
>
> Seems like this is something blk-mq should be doing.
Sounds good to me.
I was a afraid to handle this at the generic layer since it could change
what other protocols see. It looks safe, though SCSI tracks device state
differently, and I've a bad record of breaking other drivers with block
layer "fixes" recently. :)
next prev parent reply other threads:[~2016-01-26 23:59 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-25 21:23 [PATCH 1/2] NVMe: Make surprise removal work again Keith Busch
2016-01-25 21:23 ` [PATCH 2/2] NVMe: Fix io incapable return values Keith Busch
2016-01-26 16:54 ` Christoph Hellwig
2016-01-26 18:11 ` Ming Lin
2016-01-27 11:19 ` Sagi Grimberg
2016-01-26 16:53 ` [PATCH 1/2] NVMe: Make surprise removal work again Christoph Hellwig
2016-01-26 23:59 ` Keith Busch [this message]
2016-01-27 11:47 ` Sagi Grimberg
2016-01-27 14:19 ` Keith Busch
2016-01-28 14:48 ` Sagi Grimberg
2016-01-28 14:55 ` Keith Busch
2016-01-28 15:20 ` Sagi Grimberg
2016-02-01 15:01 ` Wenbo Wang
2016-02-01 15:27 ` Busch, Keith
[not found] ` <B58D82457FDA0744A320A2FC5AC253B93D3D7E57@fmsmsx104.amr.corp.intel.com>
2016-02-02 1:17 ` Keith Busch
2016-02-02 2:41 ` Wenbo Wang
2016-02-02 5:29 ` Keith Busch
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=20160126235922.GB18103@localhost.localdomain \
--to=keith.busch@intel.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.