xprtrmda: Reduce lock contention in completion handlers
authorChuck Lever <chuck.lever@oracle.com>
Wed, 28 May 2014 14:33:34 +0000 (10:33 -0400)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Wed, 4 Jun 2014 12:56:43 +0000 (08:56 -0400)
Skip the ib_poll_cq() after re-arming, if the provider knows there
are no additional items waiting. (Have a look at commit ed23a727 for
more details).

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
net/sunrpc/xprtrdma/verbs.c

index af2d097c221fc9a0dd3b1a619e9f78b01bc3e8f1..c7d5281063fd3a673a3bf1719eaa27a4ac321928 100644 (file)
@@ -192,8 +192,11 @@ rpcrdma_sendcq_upcall(struct ib_cq *cq, void *cq_context)
                return;
        }
 
-       rc = ib_req_notify_cq(cq, IB_CQ_NEXT_COMP);
-       if (rc) {
+       rc = ib_req_notify_cq(cq,
+                       IB_CQ_NEXT_COMP | IB_CQ_REPORT_MISSED_EVENTS);
+       if (rc == 0)
+               return;
+       if (rc < 0) {
                dprintk("RPC:       %s: ib_req_notify_cq failed: %i\n",
                        __func__, rc);
                return;
@@ -272,8 +275,11 @@ rpcrdma_recvcq_upcall(struct ib_cq *cq, void *cq_context)
                return;
        }
 
-       rc = ib_req_notify_cq(cq, IB_CQ_NEXT_COMP);
-       if (rc) {
+       rc = ib_req_notify_cq(cq,
+                       IB_CQ_NEXT_COMP | IB_CQ_REPORT_MISSED_EVENTS);
+       if (rc == 0)
+               return;
+       if (rc < 0) {
                dprintk("RPC:       %s: ib_req_notify_cq failed: %i\n",
                        __func__, rc);
                return;