Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 48016dce authored by Chuck Lever's avatar Chuck Lever Committed by Anna Schumaker
Browse files

xprtrdma: Avoid calls to ro_unmap_safe()



Micro-optimization: Most of the time, calls to ro_unmap_safe are
expensive no-ops. Call only when there is work to do.

Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
parent 109b88ab
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -621,6 +621,7 @@ xprt_rdma_free(struct rpc_task *task)


	dprintk("RPC:       %s: called on 0x%p\n", __func__, req->rl_reply);
	dprintk("RPC:       %s: called on 0x%p\n", __func__, req->rl_reply);


	if (unlikely(!list_empty(&req->rl_registered)))
		ia->ri_ops->ro_unmap_safe(r_xprt, req, !RPC_IS_ASYNC(task));
		ia->ri_ops->ro_unmap_safe(r_xprt, req, !RPC_IS_ASYNC(task));
	rpcrdma_unmap_sges(ia, req);
	rpcrdma_unmap_sges(ia, req);
	rpcrdma_buffer_put(req);
	rpcrdma_buffer_put(req);
@@ -657,6 +658,7 @@ xprt_rdma_send_request(struct rpc_task *task)
	int rc = 0;
	int rc = 0;


	/* On retransmit, remove any previously registered chunks */
	/* On retransmit, remove any previously registered chunks */
	if (unlikely(!list_empty(&req->rl_registered)))
		r_xprt->rx_ia.ri_ops->ro_unmap_safe(r_xprt, req, false);
		r_xprt->rx_ia.ri_ops->ro_unmap_safe(r_xprt, req, false);


	rc = rpcrdma_marshal_req(rqst);
	rc = rpcrdma_marshal_req(rqst);