nvme-tcp: don't poll a non-live queue
Sagi Grimberg
maintainerPATCH 1/1 nvme-tcp: don't poll a non-live queue
In error recovery we might be removing the queue so check we can actually poll before we do.
--- drivers/nvme/host/tcp.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/nvme/host/tcp.c +3 -0
@@ -2327,6 +2327,9 @@ static int nvme_tcp_poll(struct blk_mq_hw_ctx *hctx)struct nvme_tcp_queue *queue = hctx->driver_data;struct sock *sk = queue->sock->sk; +if (!test_bit (NVME_TCP_Q_LIVE , &queue->flags)) +return 0 ; +set_bit (NVME_TCP_Q_POLLING , &queue->flags);if (sk_can_busy_loop (sk) &&skb_queue_empty_lockless (&sk->sk_receive_queue))sk_busy_loop (sk, true);
Signature · 7 lines
2.20.1 _______________________________________________ linux-nvme mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-nvme
Quoted 6 lines
In error recovery we might be removing the queue so check we can actually poll before we do.
Reported-by Mark Wunderlich <[email protected]>Signed-off-by Sagi Grimberg <[email protected]>---
Verified to remove kernel fault caused by invalid pointer reference, seen during large writes (512K) and queue depth 32 with batch of 8. Tested on branch nvme-5.6-rc6, after adding patch this patch on top of previous patch that adds POLLING flag use by nvme_tcp_poll.
_______________________________________________
linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
_______________________________________________
linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
Sagi Grimberg
maintainerQuoted 2 lines
Verified to remove kernel fault caused by invalid pointer reference, seen during large writes (512K) and queue depth 32 with batch of 8. Tested on branch nvme-5.6-rc6, after adding patch this patch on top of previous patch that adds POLLING flag use by
nvme_tcp_poll.
The POLLING patch is not upstream yet, but shouldn't make a difference
Quoted 2 lines
Tested-by Mark Wunderlich <[email protected]>
But thanks for verifying.
_______________________________________________
linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
Keith Busch
maintainerQuoted 15 lines · Sagi Grimberg
In error recovery we might be removing the queue so check we can actually poll before we do.
Reported-by Mark Wunderlich <[email protected]>Signed-off-by Sagi Grimberg <[email protected]>--- drivers/nvme/host/tcp.c | 3 +++ 1 file changed, 3 insertions(+)drivers/nvme/host/tcp.c +0
-0
drivers/nvme/host/tcp.c static int nvme_tcp_poll(struct blk_mq_hw_ctx *hctx) · line 2335
Quoted 9 lines
drivers/nvme/host/tcp.c +3
-0@@ -2327,6 +2327,9 @@ static int nvme_tcp_poll(struct blk_mq_hw_ctx *hctx)struct nvme_tcp_queue *queue = hctx->driver_data;struct sock *sk = queue->sock->sk; +if (!test_bit (NVME_TCP_Q_LIVE , &queue->flags)) +return 0 ; +set_bit (NVME_TCP_Q_POLLING , &queue->flags);if (sk_can_busy_loop (sk) &&skb_queue_empty_lockless (&sk->sk_receive_queue))sk_busy_loop (sk, true);
Did I miss a patch recently? I couldn't find the "NVME_TCP_Q_POLLING" flag in any tree, so this patch doesn't apply as-is.
_______________________________________________
linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
Sagi Grimberg
maintainerQuoted 3 lines
Did I miss a patch recently? I couldn't find the "
NVME_TCP_Q_POLLING" flag in any tree, so this patch doesn't apply as-is.
You are correct, I sent a patch that does not apply. Thanks for letting me know, I'll send a v2.
_______________________________________________
linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme