From: "jianchao.wang" <jianchao.w.wang@oracle.com>
To: Sagi Grimberg <sagi@grimberg.me>,
keith.busch@intel.com, axboe@fb.com, hch@lst.de
Cc: linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org
Subject: Re: [PATCH V4 2/5] nvme: add helper interface to flush in-flight requests
Date: Fri, 9 Mar 2018 09:59:28 +0800 [thread overview]
Message-ID: <35c68f2a-8198-7db6-c381-420ac996802a@oracle.com> (raw)
In-Reply-To: <931a03f8-9c8b-fec4-0f89-04321a906710@grimberg.me>
Hi Sagi
Thanks for your precious time for review and comment.
On 03/09/2018 02:21 AM, Sagi Grimberg wrote:
>> +EXPORT_SYMBOL_GPL(nvme_abort_requests_sync);
>> +
>> +static void nvme_comp_req(struct request *req, void *data, bool reserved)
>
> Not a very good name...
Yes, indeed.
>
>> +{
>> + struct nvme_ctrl *ctrl = (struct nvme_ctrl *)data;
>> +
>> + if (!test_bit(NVME_REQ_ABORTED, &nvme_req(req)->flags))
>> + return;
>> +
>> + WARN_ON(!blk_mq_request_started(req));
>> +
>> + if (ctrl->tagset && ctrl->tagset->ops->complete) {
>
> What happens when this called on the admin tagset when the controller
> does not have an io tagset?
Yes, nvme_ctrl.admin_tagset should be used here for adminq request.
>
>> + clear_bit(NVME_REQ_ABORTED, &nvme_req(req)->flags);
>> + /*
>> + * We set the status to NVME_SC_ABORT_REQ, then ioq request
>> + * will be requeued and adminq one will be failed.
>> + */
>> + nvme_req(req)->status = NVME_SC_ABORT_REQ;
>> + /*
>> + * For ioq request, blk_mq_requeue_request should be better
>> + * here. But the nvme code will still setup the cmd even if
>> + * the RQF_DONTPREP is set. We have to use .complete to free
>> + * the cmd and then requeue it.
>
> IMO, its better to fix nvme to not setup the command if RQF_DONTPREP is on (other than the things it must setup).
Yes, I used to consider change that.
But I'm not sure whether there is special consideration there.
If you and Keith think it is ok that not setup command when RQF_DONTPREP is set, we could do that.
>
>> + *
>> + * For adminq request, invoking .complete directly will miss
>> + * blk_mq_sched_completed_request, but this is ok because we
>> + * won't have io scheduler for adminq.
>> + */
>> + ctrl->tagset->ops->complete(req);
>
> I don't think that directly calling .complete is a good idea...
Yes, indeed.
Thanks a lot
Jianchao
next prev parent reply other threads:[~2018-03-09 1:59 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-08 6:19 PATCH V4 0/5 nvme-pci: fixes on nvme_timeout and nvme_dev_disable Jianchao Wang
2018-03-08 6:19 ` [PATCH V4 1/5] nvme: do atomically bit operations on nvme_request.flags Jianchao Wang
2018-03-08 7:57 ` Christoph Hellwig
2018-03-08 14:32 ` jianchao.wang
2018-03-08 6:19 ` [PATCH V4 2/5] nvme: add helper interface to flush in-flight requests Jianchao Wang
2018-03-08 13:11 ` Ming Lei
2018-03-08 14:44 ` jianchao.wang
2018-03-08 18:21 ` Sagi Grimberg
2018-03-09 1:59 ` jianchao.wang [this message]
2018-03-08 6:19 ` [PATCH V4 3/5] nvme-pci: avoid nvme_dev_disable to be invoked in nvme_timeout Jianchao Wang
2018-03-09 2:01 ` jianchao.wang
2018-03-13 13:29 ` jianchao.wang
2018-03-08 6:19 ` [PATCH V4 4/5] nvme-pci: discard wait timeout when delete cq/sq Jianchao Wang
2018-03-08 6:19 ` [PATCH V4 5/5] nvme-pci: add the timeout case for DELETEING state Jianchao Wang
2018-04-17 15:17 ` PATCH V4 0/5 nvme-pci: fixes on nvme_timeout and nvme_dev_disable Ming Lei
2018-04-18 14:24 ` jianchao.wang
2018-04-18 15:40 ` Ming Lei
2018-04-19 1:51 ` jianchao.wang
2018-04-19 2:27 ` 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=35c68f2a-8198-7db6-c381-420ac996802a@oracle.com \
--to=jianchao.w.wang@oracle.com \
--cc=axboe@fb.com \
--cc=hch@lst.de \
--cc=keith.busch@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=sagi@grimberg.me \
/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®