summaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2020-11-09 14:40:08 -0500
committerAnna Schumaker <Anna.Schumaker@Netapp.com>2020-11-11 10:49:12 -0500
commit8e24e191d44f49f08f857f0ebc6fe91961cd1a09 (patch)
tree924deace34da793a328c3e49727123426c49623c /net/sunrpc
parent7703db978d4cf7c51426183b7c0d03c039757a44 (diff)
downloadlinux-stable-8e24e191d44f49f08f857f0ebc6fe91961cd1a09.tar.gz
linux-stable-8e24e191d44f49f08f857f0ebc6fe91961cd1a09.tar.bz2
linux-stable-8e24e191d44f49f08f857f0ebc6fe91961cd1a09.zip
xprtrdma: Trace unmap_sync calls
->buf_free is called nearly once per RPC. Only rarely does xprt_rdma_free() have to do anything, thus tracing every one of these calls seems unnecessary. Instead, just throw a trace event when that one occasional RPC still has MRs that need to be released. xprt_rdma_free() is further micro-optimized to reduce the amount of work done in the common case. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'net/sunrpc')
-rw-r--r--net/sunrpc/xprtrdma/transport.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/net/sunrpc/xprtrdma/transport.c b/net/sunrpc/xprtrdma/transport.c
index 8915e42240d3..bb3ed3db6c0a 100644
--- a/net/sunrpc/xprtrdma/transport.c
+++ b/net/sunrpc/xprtrdma/transport.c
@@ -599,11 +599,12 @@ static void
xprt_rdma_free(struct rpc_task *task)
{
struct rpc_rqst *rqst = task->tk_rqstp;
- struct rpcrdma_xprt *r_xprt = rpcx_to_rdmax(rqst->rq_xprt);
struct rpcrdma_req *req = rpcr_to_rdmar(rqst);
- if (!list_empty(&req->rl_registered))
- frwr_unmap_sync(r_xprt, req);
+ if (unlikely(!list_empty(&req->rl_registered))) {
+ trace_xprtrdma_mrs_zap(task);
+ frwr_unmap_sync(rpcx_to_rdmax(rqst->rq_xprt), req);
+ }
/* XXX: If the RPC is completing because of a signal and
* not because a reply was received, we ought to ensure