From: jianchao.w.wang@oracle.com (jianchao.wang)
Subject: [PATCH V3 7/8] nvme: pci: recover controller reliably
Date: Thu, 3 May 2018 23:46:56 +0800 [thread overview]
Message-ID: <ea98b607-9c8f-3b18-8314-cdcfd8bc5e96@oracle.com> (raw)
In-Reply-To: <20180503100824.GA5078@ming.t460p>
Hi Ming
Thanks for your kindly response.
On 05/03/2018 06:08 PM, Ming Lei wrote:
> nvme_eh_reset() can move on, if controller state is either CONNECTING or
> RESETTING, nvme_change_ctrl_state(&dev->ctrl, NVME_CTRL_RESETTING) won't
> be called in nvme_eh_reset(), and nvme_pre_reset_dev() will be called
> directly, then follows scheduling of the eh_reset_work.
We have to consider another context, nvme_reset_work.
There are two contexts that will invoke nvme_pre_reset_dev.
nvme_eh_reset could invoke nvme_pre_reset_dev even if the state is RESETTING or CONNECTING.
nvme_error_handler nvme_reset_ctrl
-> change state to RESETTING
-> queue reset work
nvme_reset_work
-> nvme_dev_disable
-> nvme_eh_reset
-> nvme_pre_reset_dev -> nvme_pre_reset_dev
-> change state to CONNECTING -> change state fails
-> nvme_remove_dead_ctrl
There seems to be other race scenarios between them.
Just invoke nvme_dev_disable in nvme_error_handler context and hand over the other things
to nvme_reset_work as the v2 patch series seems clearer.
The primary target of nvme_error_handler is to drain IOs and disable controller.
reset_work could take over the left things of the recovery work
IMO, modify the nvme_reset_ctrl_sync in nvme_error_handler to nvme_reset_ctrl should be ok.
If the admin ios in reset_work timeout, the nvme_error_handler could also provide help to complete them.
> There are actually two issues here, both are covered in this patchset:
>
> 1) when nvme_wait_freeze() is for draining IO, controller error may
> happen again, this patch can shutdown & reset controller again to
> recover it.
>
We could split the nvme_reset_work into two contexts instead of introduce another nvme_eh_reset.
Otherwise, the code looks really complicated.
In addition, this fix for this issue could be deferred after your great EH kthread solution is submitted.
Thanks
Jianchao
> 2) there is also another issue: queues may not be put into freeze state
> in nvme_dev_disable(), then nvme_wait_freeze() will wait forever. This
> issue is addressed by 4th patch.
>
> Both two can be observed in blktests block/011 and verified by this patches.
>
> Thanks for your great review, please let me know if there are other
> issues.
next prev parent reply other threads:[~2018-05-03 15:46 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-03 3:17 [PATCH V3 0/8] nvme: pci: fix & improve timeout handling Ming Lei
2018-05-03 3:17 ` [PATCH V3 1/8] block: introduce blk_quiesce_timeout() and blk_unquiesce_timeout() Ming Lei
2018-05-03 3:17 ` [PATCH V3 2/8] nvme: pci: cover timeout for admin commands running in EH Ming Lei
2018-05-03 3:17 ` [PATCH V3 3/8] nvme: pci: only wait freezing if queue is frozen Ming Lei
2018-05-03 3:17 ` [PATCH V3 4/8] nvme: pci: freeze queue in nvme_dev_disable() in case of error recovery Ming Lei
2018-05-03 3:17 ` [PATCH V3 5/8] nvme: fix race between freeze queues and unfreeze queues Ming Lei
2018-05-03 3:17 ` [PATCH V3 6/8] nvme: pci: split controller resetting into two parts Ming Lei
2018-05-03 3:17 ` [PATCH V3 7/8] nvme: pci: recover controller reliably Ming Lei
2018-05-03 9:14 ` jianchao.wang
2018-05-03 10:08 ` Ming Lei
2018-05-03 15:46 ` jianchao.wang [this message]
2018-05-04 4:24 ` Ming Lei
2018-05-04 6:10 ` jianchao.wang
2018-05-04 6:21 ` jianchao.wang
2018-05-04 8:02 ` Ming Lei
2018-05-04 8:28 ` jianchao.wang
2018-05-04 9:16 ` Ming Lei
2018-05-05 0:16 ` Ming Lei
2018-05-03 3:17 ` [PATCH V3 8/8] nvme: pci: simplify timeout handling 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=ea98b607-9c8f-3b18-8314-cdcfd8bc5e96@oracle.com \
--to=jianchao.w.wang@oracle.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox