[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1663432858-99743-1-git-send-email-liusong@linux.alibaba.com>
Date: Sun, 18 Sep 2022 00:40:58 +0800
From: Liu Song <liusong@...ux.alibaba.com>
To: kbusch@...nel.org, axboe@...com, hch@....de, sagi@...mberg.me
Cc: linux-nvme@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: [RFC PATCH] nvme: request remote is usually not involved for nvme devices
From: Liu Song <liusong@...ux.alibaba.com>
NVMe devices usually have a 1:1 mapping between "ctx" and "hctx",
so when "nr_ctx" is equal to 1, there is no possibility of remote
request, so the corresponding process can be simplified.
Signed-off-by: Liu Song <liusong@...ux.alibaba.com>
---
drivers/nvme/host/nvme.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h
index 216acbe..cc21896 100644
--- a/drivers/nvme/host/nvme.h
+++ b/drivers/nvme/host/nvme.h
@@ -672,6 +672,10 @@ static inline bool nvme_try_complete_req(struct request *req, __le16 status,
nvme_should_fail(req);
if (unlikely(blk_should_fake_timeout(req->q)))
return true;
+ if (likely(req->mq_hctx->nr_ctx == 1)) {
+ WRITE_ONCE(req->state, MQ_RQ_COMPLETE);
+ return false;
+ }
return blk_mq_complete_request_remote(req);
}
--
1.8.3.1
Powered by blists - more mailing lists