From: willy@linux.intel.com (Matthew Wilcox)
Subject: [PATCH] NVMe: Async event request
Date: Tue, 17 Jun 2014 23:45:38 -0400 [thread overview]
Message-ID: <20140618034538.GG12025@linux.intel.com> (raw)
In-Reply-To: <1403045638-16790-1-git-send-email-keith.busch@intel.com>
On Tue, Jun 17, 2014@04:53:58PM -0600, Keith Busch wrote:
> +static void nvme_submit_async_req(struct nvme_queue *nvmeq)
> +{
> + struct nvme_command *c;
> + int cmdid;
> +
> + cmdid = alloc_cmdid(nvmeq, CMD_CTX_ASYNC, special_completion, 0);
> + if (cmdid < 0)
> + return;
Return -EBUSY here ...
> + c = &nvmeq->sq_cmds[nvmeq->sq_tail];
> + memset(c, 0, sizeof(*c));
> + c->common.opcode = nvme_admin_async_event;
> + c->common.command_id = cmdid;
> +
> + if (++nvmeq->sq_tail == nvmeq->q_depth)
> + nvmeq->sq_tail = 0;
> + writel(nvmeq->sq_tail, nvmeq->q_db);
> +}
... and 0 here ...
> static void nvme_resubmit_bios(struct nvme_queue *nvmeq)
> {
> while (bio_list_peek(&nvmeq->sq_cong)) {
> @@ -1876,6 +1909,12 @@ static int nvme_kthread(void *data)
> nvme_cancel_ios(nvmeq, true);
> nvme_resubmit_bios(nvmeq);
> nvme_resubmit_iods(nvmeq);
> +
> + if (!i) {
> + for (; dev->event_limit > 0;
> + dev->event_limit--)
> + nvme_submit_async_req(nvmeq);
> + }
... and make this:
while ((i == 0) && (dev->event_limit > 0)) {
if (nvme_submit_async_req(nvmeq))
break;
dev->event_limit--;
}
What do you think?
next prev parent reply other threads:[~2014-06-18 3:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-17 22:53 [PATCH] NVMe: Async event request Keith Busch
2014-06-18 3:45 ` Matthew Wilcox [this message]
-- strict thread matches above, loose matches on Subject: below --
2013-06-04 23:55 Keith Busch
2013-06-05 20:01 ` Matthew Wilcox
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=20140618034538.GG12025@linux.intel.com \
--to=willy@linux.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.