svcrdma: Shrink scope of spinlock on RQ CQ
The rq_cq_reap function is only called from the dto_tasklet. The only resource shared with other threads is the sc_rq_dto_q. Move the spin lock to protect only this list. Signed-off-by: Tom Tucker <tom@opengridcomputing.com>
This commit is contained in:
parent
8740767376
commit
47698e083e
|
@ -292,7 +292,6 @@ static void rq_cq_reap(struct svcxprt_rdma *xprt)
|
||||||
ib_req_notify_cq(xprt->sc_rq_cq, IB_CQ_NEXT_COMP);
|
ib_req_notify_cq(xprt->sc_rq_cq, IB_CQ_NEXT_COMP);
|
||||||
atomic_inc(&rdma_stat_rq_poll);
|
atomic_inc(&rdma_stat_rq_poll);
|
||||||
|
|
||||||
spin_lock_bh(&xprt->sc_rq_dto_lock);
|
|
||||||
while ((ret = ib_poll_cq(xprt->sc_rq_cq, 1, &wc)) > 0) {
|
while ((ret = ib_poll_cq(xprt->sc_rq_cq, 1, &wc)) > 0) {
|
||||||
ctxt = (struct svc_rdma_op_ctxt *)(unsigned long)wc.wr_id;
|
ctxt = (struct svc_rdma_op_ctxt *)(unsigned long)wc.wr_id;
|
||||||
ctxt->wc_status = wc.status;
|
ctxt->wc_status = wc.status;
|
||||||
|
@ -303,9 +302,10 @@ static void rq_cq_reap(struct svcxprt_rdma *xprt)
|
||||||
svc_rdma_put_context(ctxt, 1);
|
svc_rdma_put_context(ctxt, 1);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
spin_lock_bh(&xprt->sc_rq_dto_lock);
|
||||||
list_add_tail(&ctxt->dto_q, &xprt->sc_rq_dto_q);
|
list_add_tail(&ctxt->dto_q, &xprt->sc_rq_dto_q);
|
||||||
|
spin_unlock_bh(&xprt->sc_rq_dto_lock);
|
||||||
}
|
}
|
||||||
spin_unlock_bh(&xprt->sc_rq_dto_lock);
|
|
||||||
|
|
||||||
if (ctxt)
|
if (ctxt)
|
||||||
atomic_inc(&rdma_stat_rq_prod);
|
atomic_inc(&rdma_stat_rq_prod);
|
||||||
|
|
Loading…
Reference in New Issue