Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

xprtrdma: Post receive buffers after RPC completion

rpcrdma_post_recvs() runs in CQ poll context and its cost
falls on the latency-critical path between polling a Receive
completion and waking the RPC consumer. Every cycle spent
refilling the Receive Queue delays delivery of the reply to
the NFS layer.

Move the rpcrdma_post_recvs() call in rpcrdma_reply_handler()
to after the RPC has been decoded and completed. The larger
batch size from the preceding patch provides sufficient
Receive Queue headroom to absorb the brief delay before
buffers are replenished.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>

authored by

Chuck Lever and committed by
Trond Myklebust
704f3f64 93b4791a

+9 -5
+9 -5
net/sunrpc/xprtrdma/rpc_rdma.c
··· 1422 1422 credits = 1; /* don't deadlock */ 1423 1423 else if (credits > r_xprt->rx_ep->re_max_requests) 1424 1424 credits = r_xprt->rx_ep->re_max_requests; 1425 - rpcrdma_post_recvs(r_xprt, credits + (buf->rb_bc_srv_max_requests << 1)); 1426 1425 if (buf->rb_credits != credits) 1427 1426 rpcrdma_update_cwnd(r_xprt, credits); 1428 1427 ··· 1440 1441 /* LocalInv completion will complete the RPC */ 1441 1442 else 1442 1443 kref_put(&req->rl_kref, rpcrdma_reply_done); 1443 - return; 1444 1444 1445 - out_badversion: 1446 - trace_xprtrdma_reply_vers_err(rep); 1447 - goto out; 1445 + out_post: 1446 + rpcrdma_post_recvs(r_xprt, 1447 + credits + (buf->rb_bc_srv_max_requests << 1)); 1448 + return; 1448 1449 1449 1450 out_norqst: 1450 1451 spin_unlock(&xprt->queue_lock); 1451 1452 trace_xprtrdma_reply_rqst_err(rep); 1453 + rpcrdma_rep_put(buf, rep); 1454 + goto out_post; 1455 + 1456 + out_badversion: 1457 + trace_xprtrdma_reply_vers_err(rep); 1452 1458 goto out; 1453 1459 1454 1460 out_shortreply: