summaryrefslogtreecommitdiffstats
path: root/drivers/nvme/host/core.c
diff options
context:
space:
mode:
authorSagi Grimberg <sagi@grimberg.me>2022-11-29 15:43:19 +0100
committerChristoph Hellwig <hch@lst.de>2022-12-06 09:17:01 +0100
commitd4d957b53d91eebc8c681c480edfdc697e55231e (patch)
treebd16c8dd155f6c0ed055035ad6f6a353b93345e7 /drivers/nvme/host/core.c
parent6887fc6495f2dfd55e088c982e983815278ee453 (diff)
downloadlinux-d4d957b53d91eebc8c681c480edfdc697e55231e.tar.bz2
nvme-multipath: support io stats on the mpath device
Our mpath stack device is just a shim that selects a bottom namespace and submits the bio to it without any fancy splitting. This also means that we don't clone the bio or have any context to the bio beyond submission. However it really sucks that we don't see the mpath device io stats. Given that the mpath device can't do that without adding some context to it, we let the bottom device do it on its behalf (somewhat similar to the approach taken in nvme_trace_bio_complete). When the IO starts, we account the request for multipath IO stats using REQ_NVME_MPATH_IO_STATS nvme_request flag to avoid queue io stats disable in the middle of the request. Signed-off-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Keith Busch <kbusch@kernel.org>
Diffstat (limited to 'drivers/nvme/host/core.c')
-rw-r--r--drivers/nvme/host/core.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index fd2e26cb7a68..7961e146bbb1 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -384,6 +384,8 @@ static inline void nvme_end_req(struct request *req)
nvme_log_error(req);
nvme_end_req_zoned(req);
nvme_trace_bio_complete(req);
+ if (req->cmd_flags & REQ_NVME_MPATH)
+ nvme_mpath_end_request(req);
blk_mq_end_request(req, status);
}