From: Rakesh Pandit <rakesh@tuxera.com>
To: Sagi Grimberg <sagi@grimberg.me>
Cc: <linux-nvme@lists.infradead.org>, <linux-kernel@vger.kernel.org>,
"Jens Axboe" <axboe@fb.com>, Keith Busch <keith.busch@intel.com>,
Christoph Hellwig <hch@lst.de>, Andy Lutomirski <luto@kernel.org>
Subject: Re: [PATCH V2] nvme: fix nvme_remove going to uninterruptible sleep for ever
Date: Tue, 30 May 2017 17:23:46 +0300 [thread overview]
Message-ID: <20170530142346.GA39428@dhcp-216.srv.tuxera.com> (raw)
In-Reply-To: <4da7c939-1f54-80e5-48fc-06e58e14f018@grimberg.me>
On Tue, May 30, 2017 at 01:18:55PM +0300, Sagi Grimberg wrote:
>
> > /*
> > + * Avoid configuration and syncing commands if controller is already
> > + * being removed and queues have been killed.
> > + */
> > + if (ctrl->state == NVME_CTRL_DELETING || ctrl->state == NVME_CTRL_DEAD)
> > + return;
> > +
>
> Hey Rakesh, Christoph,
>
> Given that the issue is for sync command submission during controller
> removal, I'm wandering if we should perhaps move this check to
> __nvme_submit_sync_cmd?
>
> AFAICT user-space can just as easily trigger set_features in the same
> condition which will trigger the hang couldn't it?
Seems possible. But it seems worth keeping this check as it avoids
the instructions between start of nvme_configure_apst and
__nvme_submit_sync_cmd. This check seems to solve more severe hang as
PID which started off from nvme_remove eventually hangs itself on
blk_execute_rq..
We can fix user-space triggered set_features higger up e.g. in
nvme_ioctl by putting same check. Introduction of a separate state
NVME_CTRL_SCHED_RESET (being discussed in another thread) has
additional advantage of making sure that only one thread is going
through resetting and eventually through removal (if required) and
solves lot of problems.
It makes sense to push this separately because of above reasons and we
can fix user space trigger of deadlock once discussion on another
thread has moved forward on introducing of new state.
next prev parent reply other threads:[~2017-05-30 14:24 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-30 7:16 Rakesh Pandit
2017-05-30 9:36 ` Christoph Hellwig
2017-05-30 10:18 ` Sagi Grimberg
2017-05-30 14:23 ` Rakesh Pandit [this message]
2017-06-01 11:43 ` Christoph Hellwig
2017-06-01 12:28 ` Rakesh Pandit
2017-06-01 12:35 ` Christoph Hellwig
2017-06-01 12:36 ` Rakesh Pandit
2017-06-01 12:46 ` Christoph Hellwig
2017-06-01 14:56 ` Ming Lei
2017-06-01 19:33 ` Rakesh Pandit
2017-06-02 1:42 ` Ming Lei
2017-06-04 15:28 ` Sagi Grimberg
2017-06-05 8:18 ` Christoph Hellwig
2017-06-05 10:52 ` Rakesh Pandit
2017-06-05 11:09 ` Sagi Grimberg
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=20170530142346.GA39428@dhcp-216.srv.tuxera.com \
--to=rakesh@tuxera.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=luto@kernel.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®