From: "jianchao.wang" <jianchao.w.wang@oracle.com>
To: keith.busch@intel.com, axboe@fb.com, hch@lst.de, sagi@grimberg.me
Cc: linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org
Subject: Re: [PATCH] nvme-pci: use NOWAIT flag for nvme_set_host_mem
Date: Mon, 29 Jan 2018 16:06:13 +0800 [thread overview]
Message-ID: <40b52195-95c8-4c33-39cc-dc80043161a2@oracle.com> (raw)
In-Reply-To: <1517195255-21832-1-git-send-email-jianchao.w.wang@oracle.com>
On 01/29/2018 11:07 AM, Jianchao Wang wrote:
> nvme_set_host_mem will invoke nvme_alloc_request without NOWAIT
> flag, it is unsafe for nvme_dev_disable. The adminq driver tags
> may have been used up when the previous outstanding adminq requests
> cannot be completed due to some hardware error. We have to depend
> on the timeout path to complete the previous outstanding adminq
> requests and free the tags.
> However, nvme_timeout will invoke nvme_dev_disable and try to
> get the shutdown_lock which is held by another context who is
> sleeping to wait for the tags to be freed by timeout path. A
> deadlock comes up.
>
> To fix it, let nvme_set_host_mem use NOWAIT flag.
In fact, this is the only case about nvme_set_host_mem in
nvme_dev_disable.
Consider the following case:
A adminq request expired.
timeout_work context
nvme_timeout
-> nvme_dev_disable
-> nvme_set_host_mem
if this adminq request expires again, the timeout_work
cannot handle this case, because it is waiting for the
result of nvme_set_host_mem.
Thanks
Jianchao
next prev parent reply other threads:[~2018-01-29 8:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-29 3:07 Jianchao Wang
2018-01-29 8:06 ` jianchao.wang [this message]
2018-01-29 16:01 ` Keith Busch
2018-01-29 19:55 ` Sagi Grimberg
2018-01-29 20:17 ` Keith Busch
2018-01-30 3:41 ` jianchao.wang
2018-01-30 16:13 ` 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=40b52195-95c8-4c33-39cc-dc80043161a2@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®