Skip to contentSkip to conversation

nvme: fix multipath batched completion accounting

PATCH In review Keith Busch 5 participants 5 messages May 21, 2024 – May 23, 2024 NVMe

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvme: fix multipath batched completion accounting

From: Keith Busch <[email protected]>

Batched completions were missing the io stats accounting and bio trace events. Move the common code to a helper and call it from the batched and non-batched functions.

Fixes d4d957b53d91ee ("nvme-multipath: support io stats on the mpath device")
---
 drivers/nvme/host/core.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
drivers/nvme/host/core.c +10 -5
index 954f850f113a1..79cdd34dfa18e 100644
@@ -414,6 +414,14 @@ static inline void nvme_end_req_zoned(struct request *req)
 	}
 }
 
+static inline void __nvme_end_req(struct request *req)
+{
+	nvme_end_req_zoned(req);
+	nvme_trace_bio_complete(req);
+	if (req->cmd_flags & REQ_NVME_MPATH)
+		nvme_mpath_end_request(req);
+}
+
 static inline void nvme_end_req(struct request *req)
 {
 	blk_status_t status = nvme_error_status(nvme_req(req)->status);
@@ -424,10 +432,7 @@ static inline void nvme_end_req(struct request *req)
 		else
 			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);
+	__nvme_end_req(req);
 	blk_mq_end_request(req, status);
 }
 
@@ -476,7 +481,7 @@ void nvme_complete_batch_req(struct request *req)
 {
 	trace_nvme_complete_rq(req);
 	nvme_cleanup_cmd(req);
-	nvme_end_req_zoned(req);
+	__nvme_end_req(req);
 }
 EXPORT_SYMBOL_GPL(nvme_complete_batch_req);
 
Signature · 1 line
2.43.0
Reviewed-by on v1 1/1
#3 lore raw
In reply to Keith Busch
Quoted 9 lines · Keith Busch

From: Keith Busch <[email protected]>

Batched completions were missing the io stats accounting and bio trace events. Move the common code to a helper and call it from the batched and non-batched functions.

Fixes d4d957b53d91ee ("nvme-multipath: support io stats on the mpath device")

Looks good.

-ck

Reviewed-by on v1 1/1
#4 lore raw
In reply to Keith Busch
Quoted 6 lines · Keith Busch

From: Keith Busch <[email protected]>

Batched completions were missing the io stats accounting and bio trace events. Move the common code to a helper and call it from the batched and non-batched functions.

Quoted 6 lines
Fixes d4d957b53d91ee ("nvme-multipath: support io stats on the mpath device")
---
  drivers/nvme/host/core.c | 15 ++++++++++-----
  1 file changed, 10 insertions(+), 5 deletions(-)

Cheers,

Hannes