Skip to content

Commit 7f23f6f

Browse files
chuckleveramschuma-ntap
authored andcommitted
xprtrmda: Reduce lock contention in completion handlers
Skip the ib_poll_cq() after re-arming, if the provider knows there are no additional items waiting. (Have a look at commit ed23a72 for more details). Signed-off-by: Chuck Lever <[email protected]> Signed-off-by: Anna Schumaker <[email protected]>
1 parent fc66448 commit 7f23f6f

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

net/sunrpc/xprtrdma/verbs.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,11 @@ rpcrdma_sendcq_upcall(struct ib_cq *cq, void *cq_context)
192192
return;
193193
}
194194

195-
rc = ib_req_notify_cq(cq, IB_CQ_NEXT_COMP);
196-
if (rc) {
195+
rc = ib_req_notify_cq(cq,
196+
IB_CQ_NEXT_COMP | IB_CQ_REPORT_MISSED_EVENTS);
197+
if (rc == 0)
198+
return;
199+
if (rc < 0) {
197200
dprintk("RPC: %s: ib_req_notify_cq failed: %i\n",
198201
__func__, rc);
199202
return;
@@ -272,8 +275,11 @@ rpcrdma_recvcq_upcall(struct ib_cq *cq, void *cq_context)
272275
return;
273276
}
274277

275-
rc = ib_req_notify_cq(cq, IB_CQ_NEXT_COMP);
276-
if (rc) {
278+
rc = ib_req_notify_cq(cq,
279+
IB_CQ_NEXT_COMP | IB_CQ_REPORT_MISSED_EVENTS);
280+
if (rc == 0)
281+
return;
282+
if (rc < 0) {
277283
dprintk("RPC: %s: ib_req_notify_cq failed: %i\n",
278284
__func__, rc);
279285
return;

0 commit comments

Comments
 (0)