diff mbox series

[1,4/4] svcrdma: Retain the page backing rq_res.head[0].iov_base

Message ID 161653184711.1499.18423742648834808627.stgit@klimt.1015granger.net (mailing list archive)
State New
Headers show
Series Move post-send page release into svc_sendto | expand

Commit Message

Chuck Lever III March 23, 2021, 8:37 p.m. UTC
svc_rdma_sendto() now waits for the NIC hardware to finish with
the pages backing rq_res. We still have to release the page array
in some cases, but now it's always safe to immediately re-use the
page backing rq_res's head buffer.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
 net/sunrpc/xprtrdma/svc_rdma_sendto.c |    5 +++++
 1 file changed, 5 insertions(+)
diff mbox series


diff --git a/net/sunrpc/xprtrdma/svc_rdma_sendto.c b/net/sunrpc/xprtrdma/svc_rdma_sendto.c
index f093c9b536ff..056452cabc98 100644
--- a/net/sunrpc/xprtrdma/svc_rdma_sendto.c
+++ b/net/sunrpc/xprtrdma/svc_rdma_sendto.c
@@ -957,6 +957,11 @@  int svc_rdma_sendto(struct svc_rqst *rqstp)
 	ret = svc_rdma_send_reply_msg(rdma, sctxt, rctxt, rqstp);
 	if (ret < 0)
 		goto err1;
+	/* Prevent svc_xprt_release() from releasing the page backing
+	 * rq_res.head[0].iov_base. It's no longer being accessed by
+	 * the I/O device. */
+	rqstp->rq_respages++;
 	return 0;