git: bc85cd303c44 - main - nvme: gc nvme_ctrlr_post_failed_request and related task stuff
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 10 Oct 2023 22:26:15 UTC
The branch main has been updated by imp:
URL: https://cgit.FreeBSD.org/src/commit/?id=bc85cd303c448b5006975024c4b468f5614507c5
commit bc85cd303c448b5006975024c4b468f5614507c5
Author: Warner Losh <imp@FreeBSD.org>
AuthorDate: 2023-10-10 17:09:24 +0000
Commit: Warner Losh <imp@FreeBSD.org>
CommitDate: 2023-10-10 22:13:56 +0000
nvme: gc nvme_ctrlr_post_failed_request and related task stuff
In 4b977e6dda92 we removed the call to nvme_ctrlr_post_failed_request
because we can now directly fail requests in this context since we're in
the reset task already. No need to queue it. I left it in place against
future need, but it's been two years and no panics have resulted. Since
the static analysis (code checking) and the dyanmic analysis (surviving
in the field for 2 years, including at $WORK where we know we've gone
through this path when we've failed drives) both signal that it's not
really needed, go ahead and GC it. If we discover at a later date a flaw
in this analysis, we can add it back easily enough by reverting this and
4b977e6dda92.
Sponsored by: Netflix
Reviewed by: chuck, gallatin, jhb
Differential Revision: https://reviews.freebsd.org/D42048
---
sys/dev/nvme/nvme_ctrlr.c | 30 ------------------------------
sys/dev/nvme/nvme_private.h | 3 ---
2 files changed, 33 deletions(-)
diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c
index ef4d7daa6efa..968c873fe06c 100644
--- a/sys/dev/nvme/nvme_ctrlr.c
+++ b/sys/dev/nvme/nvme_ctrlr.c
@@ -232,35 +232,6 @@ nvme_ctrlr_fail(struct nvme_controller *ctrlr)
nvme_notify_fail_consumers(ctrlr);
}
-void
-nvme_ctrlr_post_failed_request(struct nvme_controller *ctrlr,
- struct nvme_request *req)
-{
-
- mtx_lock(&ctrlr->lock);
- STAILQ_INSERT_TAIL(&ctrlr->fail_req, req, stailq);
- mtx_unlock(&ctrlr->lock);
- if (!ctrlr->is_dying)
- taskqueue_enqueue(ctrlr->taskqueue, &ctrlr->fail_req_task);
-}
-
-static void
-nvme_ctrlr_fail_req_task(void *arg, int pending)
-{
- struct nvme_controller *ctrlr = arg;
- struct nvme_request *req;
-
- mtx_lock(&ctrlr->lock);
- while ((req = STAILQ_FIRST(&ctrlr->fail_req)) != NULL) {
- STAILQ_REMOVE_HEAD(&ctrlr->fail_req, stailq);
- mtx_unlock(&ctrlr->lock);
- nvme_qpair_manual_complete_request(req->qpair, req,
- NVME_SCT_GENERIC, NVME_SC_ABORTED_BY_REQUEST);
- mtx_lock(&ctrlr->lock);
- }
- mtx_unlock(&ctrlr->lock);
-}
-
/*
* Wait for RDY to change.
*
@@ -1487,7 +1458,6 @@ nvme_ctrlr_construct(struct nvme_controller *ctrlr, device_t dev)
ctrlr->is_initialized = 0;
ctrlr->notification_sent = 0;
TASK_INIT(&ctrlr->reset_task, 0, nvme_ctrlr_reset_task, ctrlr);
- TASK_INIT(&ctrlr->fail_req_task, 0, nvme_ctrlr_fail_req_task, ctrlr);
STAILQ_INIT(&ctrlr->fail_req);
ctrlr->is_failed = false;
diff --git a/sys/dev/nvme/nvme_private.h b/sys/dev/nvme/nvme_private.h
index 496bd8229e0a..c573fbfd572f 100644
--- a/sys/dev/nvme/nvme_private.h
+++ b/sys/dev/nvme/nvme_private.h
@@ -255,7 +255,6 @@ struct nvme_controller {
uint32_t queues_created;
struct task reset_task;
- struct task fail_req_task;
struct taskqueue *taskqueue;
/* For shared legacy interrupt. */
@@ -410,8 +409,6 @@ void nvme_ctrlr_submit_admin_request(struct nvme_controller *ctrlr,
struct nvme_request *req);
void nvme_ctrlr_submit_io_request(struct nvme_controller *ctrlr,
struct nvme_request *req);
-void nvme_ctrlr_post_failed_request(struct nvme_controller *ctrlr,
- struct nvme_request *req);
int nvme_qpair_construct(struct nvme_qpair *qpair,
uint32_t num_entries, uint32_t num_trackers,