Skip to content

Commit 4d9d69d

Browse files
committed
svcrdma: Add back svc_rdma_recv_ctxt::rc_pages
Having an nfsd thread waiting for an RDMA Read completion is problematic if the Read responder (the client) stops responding. We need to go back to handling RDMA Reads by allowing the nfsd thread to return to the svc scheduler, then waking a second thread finish the RPC message once the Read completion fires. To start with, restore the rc_pages field so that RDMA Read pages can be managed across calls to svc_rdma_recvfrom(). Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
1 parent fc2e69d commit 4d9d69d

3 files changed

Lines changed: 11 additions & 2 deletions

File tree

include/linux/sunrpc/svc_rdma.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@ struct svc_rdma_recv_ctxt {
183183
void *rc_recv_buf;
184184
struct xdr_stream rc_stream;
185185
u32 rc_byte_len;
186-
unsigned int rc_page_count;
187186
u32 rc_inv_rkey;
188187
__be32 rc_msgtype;
189188

@@ -199,6 +198,9 @@ struct svc_rdma_recv_ctxt {
199198
struct svc_rdma_chunk *rc_cur_result_payload;
200199
struct svc_rdma_pcl rc_write_pcl;
201200
struct svc_rdma_pcl rc_reply_pcl;
201+
202+
unsigned int rc_page_count;
203+
struct page *rc_pages[RPCSVC_MAXPAGES];
202204
};
203205

204206
struct svc_rdma_send_ctxt {

net/sunrpc/xprtrdma/svc_rdma_recvfrom.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,11 @@ struct svc_rdma_recv_ctxt *svc_rdma_recv_ctxt_get(struct svcxprt_rdma *rdma)
214214
void svc_rdma_recv_ctxt_put(struct svcxprt_rdma *rdma,
215215
struct svc_rdma_recv_ctxt *ctxt)
216216
{
217+
/* @rc_page_count is normally zero here, but error flows
218+
* can leave pages in @rc_pages.
219+
*/
220+
release_pages(ctxt->rc_pages, ctxt->rc_page_count);
221+
217222
pcl_free(&ctxt->rc_call_pcl);
218223
pcl_free(&ctxt->rc_read_pcl);
219224
pcl_free(&ctxt->rc_write_pcl);

net/sunrpc/xprtrdma/svc_rdma_rw.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1131,7 +1131,9 @@ int svc_rdma_process_read_list(struct svcxprt_rdma *rdma,
11311131
rqstp->rq_respages = &rqstp->rq_pages[head->rc_page_count];
11321132
rqstp->rq_next_page = rqstp->rq_respages + 1;
11331133

1134-
/* Ensure svc_rdma_recv_ctxt_put() does not try to release pages */
1134+
/* Ensure svc_rdma_recv_ctxt_put() does not release pages
1135+
* left in @rc_pages while I/O proceeds.
1136+
*/
11351137
head->rc_page_count = 0;
11361138

11371139
out_err:

0 commit comments

Comments
 (0)