[v1,18/18] xprtrdma: Optimize rpcrdma_post_recvs()
diff mbox series

Message ID 20190806155521.9529.80398.stgit@manet.1015granger.net
State New
Headers show
Series
  • NFS/RDMA patches
Related show

Commit Message

Chuck Lever Aug. 6, 2019, 3:55 p.m. UTC
Micro-optimization: In rpcrdma_post_recvs, since commit e340c2d6ef2a
("xprtrdma: Reduce the doorbell rate (Receive)"), the common case is
to return without doing anything. Found with perf.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 net/sunrpc/xprtrdma/verbs.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/net/sunrpc/xprtrdma/verbs.c b/net/sunrpc/xprtrdma/verbs.c
index 4112b8a..36e840b 100644
--- a/net/sunrpc/xprtrdma/verbs.c
+++ b/net/sunrpc/xprtrdma/verbs.c
@@ -1457,7 +1457,7 @@  static void rpcrdma_regbuf_free(struct rpcrdma_regbuf *rb)
 	count = 0;
 
 	needed = buf->rb_credits + (buf->rb_bc_srv_max_requests << 1);
-	if (ep->rep_receive_count > needed)
+	if (likely(ep->rep_receive_count > needed))
 		goto out;
 	needed -= ep->rep_receive_count;
 	if (!temp)