From: keith.busch@intel.com (Keith Busch)
Subject: [PATCH] NVMe: Use error handling on failed sync commands
Date: Fri, 20 Dec 2013 12:41:08 -0700 (MST) [thread overview]
Message-ID: <alpine.LRH.2.03.1312201217060.4958@AMR> (raw)
In-Reply-To: <20131220184710.GB4945@linux.intel.com>
On Fri, 20 Dec 2013, Matthew Wilcox wrote:
> On Fri, Dec 20, 2013@11:14:09AM -0700, Keith Busch wrote:
>> Sync commands schedule an internal timeout to cancel rather than using
>> the nvme timeout handler kthread. We should still try to recover so
>> moving the check for cancelled commands after the error handling.
>
>> if (timeout && !time_after(now, info[cmdid].timeout))
>> continue;
>> - if (info[cmdid].ctx == CMD_CTX_CANCELLED)
>> - continue;
>> if (timeout && nvmeq->dev->initialized) {
>> nvme_abort_cmd(cmdid, nvmeq);
>> continue;
>> }
>> + if (info[cmdid].ctx == CMD_CTX_CANCELLED)
>> + continue;
>> dev_warn(nvmeq->q_dmadev, "Cancelling I/O %d QID %d\n", cmdid,
>> nvmeq->qid);
>> ctx = cancel_cmdid(nvmeq, cmdid, &fn);
>
> I'm confused by this patch. Won't it cause us to send abort commands
> repeatedly for commands IDs that have already been cancelled, but haven't
> yet been completed as cancelled?
It appears so, but 'nvme_abort_cmd' aborts only once then resets the
controller if the command still isn't returned. The drive is not polled
for timeouts when the reset handler is running so it won't timeout
again, and the command is forced cancelled during reset with cancel_ios()
'timeout' set to false.
'sync_command' is the only place an IO can be cancelled while the
device being polled for timeouts. I think we want to try recovering the
unresponsive controller even if the sync timeout already cancelled.
Without this patch, a failed sync command just leaks a cmdid until the
controller is reset some other way.
prev parent reply other threads:[~2013-12-20 19:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-20 18:14 [PATCH] NVMe: Use error handling on failed sync commands Keith Busch
2013-12-20 18:47 ` Matthew Wilcox
2013-12-20 19:41 ` Keith Busch [this message]
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=alpine.LRH.2.03.1312201217060.4958@AMR \
--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.