From: Jaesoo Lee <jalee@purestorage.com>
To: keith.busch@intel.com, axboe@fb.com, hch@lst.de, sagi@grimberg.me
Cc: linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org,
psajeepa@purestorage.com, roland@purestorage.com,
ashishk@purestorage.com, jalee@purestorage.com
Subject: [PATCH] nvme-rdma: complete requests from ->timeout
Date: Thu, 29 Nov 2018 15:59:14 -0800 [thread overview]
Message-ID: <1543535954-28073-1-git-send-email-jalee@purestorage.com> (raw)
After f6e7d48 (block: remove BLK_EH_HANDLED), the low-level device driver
is responsible to complete the timed out request and a series of changes
were submitted for various LLDDs to make completions from ->timeout
subsequently. However, adding the completion code in NVMe driver was
skipped with the assumption made in below NVMe LLDD's change.
Commit message of db8c48e (nvme: return BLK_EH_DONE from ->timeout):
NVMe always completes the request before returning from ->timeout, either
by polling for it, or by disabling the controller. Return BLK_EH_DONE so
that the block layer doesn't even try to complete it again.
This does not hold at least for NVMe RDMA host driver. An example scenario
is when the RDMA connection is gone while the controller is being deleted.
In this case, the nvmf_reg_write32() for sending shutdown admin command by
the delete_work could be hung forever if the command is not completed by
the timeout handler.
Stack trace of hang looks like:
kworker/u66:2 D 0 21098 2 0x80000080
Workqueue: nvme-delete-wq nvme_delete_ctrl_work
Call Trace:
__schedule+0x2ab/0x880
schedule+0x36/0x80
schedule_timeout+0x161/0x300
? __next_timer_interrupt+0xe0/0xe0
io_schedule_timeout+0x1e/0x50
wait_for_completion_io_timeout+0x130/0x1a0
? wake_up_q+0x80/0x80
blk_execute_rq+0x6e/0xa0
__nvme_submit_sync_cmd+0x6e/0xe0
nvmf_reg_write32+0x6c/0xc0 [nvme_fabrics]
nvme_shutdown_ctrl+0x56/0x110
nvme_rdma_shutdown_ctrl+0xf8/0x100 [nvme_rdma]
nvme_rdma_delete_ctrl+0x1a/0x20 [nvme_rdma]
nvme_delete_ctrl_work+0x66/0x90
process_one_work+0x179/0x390
worker_thread+0x1da/0x3e0
kthread+0x105/0x140
? max_active_store+0x80/0x80
? kthread_bind+0x20/0x20
ret_from_fork+0x35/0x40
Signed-off-by: Jaesoo Lee <jalee@purestorage.com>
---
drivers/nvme/host/rdma.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c
index d181caf..25319b7 100644
--- a/drivers/nvme/host/rdma.c
+++ b/drivers/nvme/host/rdma.c
@@ -1688,6 +1688,7 @@ static int nvme_rdma_cm_handler(struct rdma_cm_id *cm_id,
/* fail with DNR on cmd timeout */
nvme_req(rq)->status = NVME_SC_ABORT_REQ | NVME_SC_DNR;
+ blk_mq_complete_request(rq);
return BLK_EH_DONE;
}
--
1.9.1
next reply other threads:[~2018-11-29 23:59 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-29 23:59 Jaesoo Lee [this message]
2018-11-30 1:30 ` [PATCH] nvme-rdma: complete requests from ->timeout Sagi Grimberg
2018-11-30 1:54 ` Jaesoo Lee
2018-12-07 0:18 ` Jaesoo Lee
2018-12-07 20:05 ` Sagi Grimberg
2018-12-08 2:02 ` Keith Busch
2018-12-08 6:28 ` Jaesoo Lee
2018-12-09 14:22 ` Nitzan Carmi
2018-12-10 23:40 ` Jaesoo Lee
2018-12-11 9:14 ` Nitzan Carmi
2018-12-11 23:16 ` Jaesoo Lee
2018-12-11 23:38 ` Sagi Grimberg
2018-12-12 1:31 ` Jaesoo Lee
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=1543535954-28073-1-git-send-email-jalee@purestorage.com \
--to=jalee@purestorage.com \
--cc=ashishk@purestorage.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=psajeepa@purestorage.com \
--cc=roland@purestorage.com \
--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;
as well as URLs for NNTP newsgroup(s).