aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/clnt.c
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@hammerspace.com>2018-08-14 13:58:34 -0400
committerTrond Myklebust <trond.myklebust@hammerspace.com>2018-09-30 15:35:14 -0400
commit3a03818fbee0a85196a2214f07db9e2b622e2550 (patch)
tree456fb5e4ff9c57f1adfdac7dedcc61f2f3fb14a4 /net/sunrpc/clnt.c
parent7ebbbc6e7bd023903daa5bd95726edf2d60b559c (diff)
downloadlinux-3a03818fbee0a85196a2214f07db9e2b622e2550.tar.gz
SUNRPC: Avoid holding locks across the XDR encoding of the RPC message
Currently, we grab the socket bit lock before we allow the message to be XDR encoded. That significantly slows down the transmission rate, since we serialise on a potentially blocking operation. Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to 'net/sunrpc/clnt.c')
-rw-r--r--net/sunrpc/clnt.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index e5ac35e803ad39..a858366cd15db8 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -1949,9 +1949,6 @@ call_transmit(struct rpc_task *task)
task->tk_action = call_status;
if (task->tk_status < 0)
return;
- if (!xprt_prepare_transmit(task))
- return;
- task->tk_action = call_transmit_status;
/* Encode here so that rpcsec_gss can use correct sequence number. */
if (rpc_task_need_encode(task)) {
rpc_xdr_encode(task);
@@ -1965,6 +1962,9 @@ call_transmit(struct rpc_task *task)
return;
}
}
+ if (!xprt_prepare_transmit(task))
+ return;
+ task->tk_action = call_transmit_status;
xprt_transmit(task);
if (task->tk_status < 0)
return;