nvmet: handle rw's limited retry flag
Subsystems (2)
PATCH v3 1/1 nvmet: handle rw's limited retry flag
In some scenarios, some multipath software setup places the REQ_FAILFAST_DEV flag on I/O to prevent retries and immediately switch to other paths for issuing I/O commands. This will reflect on the NVMe read and write commands with the limited retry flag.
However, the current NVMe target side does not handle the limited retry flag, and the target's underlying driver still retries the I/O. This will result in the I/O not being quickly switched to other paths, ultimately leading to increased I/O latency.
When the nvme target receive an rw command with limited retry flag, handle it in block backend by setting the REQ_FAILFAST_DEV flag to bio.
---
Changes from v2 to v3:
- Add the rb tag from Christoph, thanks.
Changes from v1 to v2:
- Add details to commit body(Christoph).
- Add the rb tag from Chaitanya, thanks.
drivers/nvme/target/io-cmd-bdev.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/nvme/target/io-cmd-bdev.c +3 -0
@@ -272,6 +272,9 @@ static void nvmet_bdev_execute_rw(struct nvmet_req *req) iter_flags =SG_MITER_FROM_SG ; } +if (req->cmd->rw.control &NVME_RW_LR ) + opf |=REQ_FAILFAST_DEV ; +if (is_pci_p2pdma_page (sg_page (req->sg))) opf |=REQ_NOMERGE ;
Signature · 1 line
2.43.0
Hi Keith,
Could you plz apply this patch?
Best Regards,
Guixin Liu
Quoted 42 lines · Guixin Liu
In some scenarios, some multipath software setup places the
REQ_FAILFAST_DEVflag on I/O to prevent retries and immediately switch to other paths for issuing I/O commands. This will reflect on the NVMe read and write commands with the limited retry flag.However, the current NVMe target side does not handle the limited retry flag, and the target's underlying driver still retries the I/O. This will result in the I/O not being quickly switched to other paths, ultimately leading to increased I/O latency.
When the nvme target receive an rw command with limited retry flag, handle it in block backend by setting the
REQ_FAILFAST_DEVflag to bio.Signed-off-by Guixin Liu <[email protected]>Reviewed-by Chaitanya Kulkarni <[email protected]>Reviewed-by Christoph Hellwig <[email protected]>---
Changes from v2 to v3:
- Add the rb tag from Christoph, thanks.Changes from v1 to v2:
- Add details to commit body(Christoph).
- Add the rb tag from Chaitanya, thanks.drivers/nvme/target/io-cmd-bdev.c | 3 +++ 1 file changed, 3 insertions(+)drivers/nvme/target/io-cmd-bdev.c +3
-0@@ -272,6 +272,9 @@ static void nvmet_bdev_execute_rw(struct nvmet_req *req) iter_flags =SG_MITER_FROM_SG ; } +if (req->cmd->rw.control &NVME_RW_LR ) + opf |=REQ_FAILFAST_DEV ; +if (is_pci_p2pdma_page (sg_page (req->sg))) opf |=REQ_NOMERGE ;
Quoted 5 lines · Guixin Liu
In some scenarios, some multipath software setup places the
REQ_FAILFAST_DEVflag on I/O to prevent retries and immediately switch to other paths for issuing I/O commands. This will reflect on the NVMe read and write commands with the limited retry flag.
Quoted 8 lines
However, the current NVMe target side does not handle the limited retry flag, and the target's underlying driver still retries the I/O. This will result in the I/O not being quickly switched to other paths, ultimately leading to increased I/O latency.
When the nvme target receive an rw command with limited retry flag, handle it in block backend by setting the
REQ_FAILFAST_DEVflag to bio.
Thanks, applied to nvme-6.14.