[PATCH 2/3] nvme-tcp: Check for write space before queueing requests
Hannes Reinecke
hare at suse.de
Wed May 18 23:26:16 PDT 2022
The current model of always queue incoming requests lead to
write stalls as we easily overload the network device under
high I/O load.
To avoid unlimited queueing we should rather check if write
space is available before accepting new requests.
Signed-off-by: Hannes Reinecke <hare at suse.de>
---
drivers/nvme/host/tcp.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c
index ede76a0719a0..606565a4c708 100644
--- a/drivers/nvme/host/tcp.c
+++ b/drivers/nvme/host/tcp.c
@@ -2464,6 +2464,9 @@ static blk_status_t nvme_tcp_queue_rq(struct blk_mq_hw_ctx *hctx,
if (unlikely(ret))
return ret;
+ if (!sk_stream_is_writeable(queue->sock->sk))
+ return BLK_STS_RESOURCE;
+
blk_mq_start_request(rq);
nvme_tcp_queue_request(req, true, bd->last);
--
2.29.2
More information about the Linux-nvme
mailing list