* [PATCH] nvmet: handle rw's limited retry flag
@ 2024-11-21 10:24 Guixin Liu
2024-11-22 6:23 ` Chaitanya Kulkarni
2024-11-22 12:09 ` Christoph Hellwig
0 siblings, 2 replies; 6+ messages in thread
From: Guixin Liu @ 2024-11-21 10:24 UTC (permalink / raw)
To: Christoph Hellwig, Sagi Grimberg, Chaitanya Kulkarni, Keith Busch
Cc: linux-nvme
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.
Signed-off-by: Guixin Liu <kanie@linux.alibaba.com>
---
drivers/nvme/target/io-cmd-bdev.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/nvme/target/io-cmd-bdev.c b/drivers/nvme/target/io-cmd-bdev.c
index 0bda83d0fc3e..6380b60fd490 100644
--- a/drivers/nvme/target/io-cmd-bdev.c
+++ b/drivers/nvme/target/io-cmd-bdev.c
@@ -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;
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] nvmet: handle rw's limited retry flag
2024-11-21 10:24 [PATCH] nvmet: handle rw's limited retry flag Guixin Liu
@ 2024-11-22 6:23 ` Chaitanya Kulkarni
2024-11-22 12:09 ` Christoph Hellwig
1 sibling, 0 replies; 6+ messages in thread
From: Chaitanya Kulkarni @ 2024-11-22 6:23 UTC (permalink / raw)
To: Guixin Liu, Christoph Hellwig, Sagi Grimberg, Chaitanya Kulkarni,
Keith Busch
Cc: linux-nvme@lists.infradead.org
On 11/21/24 02:24, Guixin Liu wrote:
> 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.
>
> Signed-off-by: Guixin Liu<kanie@linux.alibaba.com>
Looks good.
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
-ck
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] nvmet: handle rw's limited retry flag
2024-11-21 10:24 [PATCH] nvmet: handle rw's limited retry flag Guixin Liu
2024-11-22 6:23 ` Chaitanya Kulkarni
@ 2024-11-22 12:09 ` Christoph Hellwig
2024-11-25 6:53 ` Guixin Liu
1 sibling, 1 reply; 6+ messages in thread
From: Christoph Hellwig @ 2024-11-22 12:09 UTC (permalink / raw)
To: Guixin Liu
Cc: Christoph Hellwig, Sagi Grimberg, Chaitanya Kulkarni, Keith Busch,
linux-nvme
On Thu, Nov 21, 2024 at 06:24:54PM +0800, Guixin Liu wrote:
> 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.
Do you have a use case where this makes a difference?
The code itself looks fine, but I doubt it's actually useful.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] nvmet: handle rw's limited retry flag
2024-11-22 12:09 ` Christoph Hellwig
@ 2024-11-25 6:53 ` Guixin Liu
2024-11-25 6:56 ` Christoph Hellwig
0 siblings, 1 reply; 6+ messages in thread
From: Guixin Liu @ 2024-11-25 6:53 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Sagi Grimberg, Chaitanya Kulkarni, Keith Busch, linux-nvme
在 2024/11/22 20:09, Christoph Hellwig 写道:
> On Thu, Nov 21, 2024 at 06:24:54PM +0800, Guixin Liu wrote:
>> 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.
> Do you have a use case where this makes a difference?
>
> The code itself looks fine, but I doubt it's actually useful.
In our scenario, our multipath 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. I believe this will result in the I/O not
being quickly
switched to other paths, ultimately leading to increased I/O latency.
Best Regards,
Guixin Liu
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-11-25 6:57 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-21 10:24 [PATCH] nvmet: handle rw's limited retry flag Guixin Liu
2024-11-22 6:23 ` Chaitanya Kulkarni
2024-11-22 12:09 ` Christoph Hellwig
2024-11-25 6:53 ` Guixin Liu
2024-11-25 6:56 ` Christoph Hellwig
2024-11-25 6:57 ` Guixin Liu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox