Message ID | 1489003252-1893-1-git-send-email-sagi@grimberg.me (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
Looks good,
Reviewed-by: Christoph Hellwig <hch@lst.de>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
On Wed, 2017-03-08 at 22:00 +0200, Sagi Grimberg wrote: > We need to make sure that the cq work item does not > run when we are destroying the cq. Unlike flush_work, > cancel_work_sync protects against self-requeue of the > work item (which we can do in ib_cq_poll_work). Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com>-- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Wed, Mar 08, 2017 at 10:00:52PM +0200, Sagi Grimberg wrote: > We need to make sure that the cq work item does not > run when we are destroying the cq. Unlike flush_work, > cancel_work_sync protects against self-requeue of the > work item (which we can do in ib_cq_poll_work). > > Signed-off-by: Sagi Grimberg <sagi@grimberg.me> > --- Thanks, Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
On Wed, 2017-03-08 at 22:00 +0200, Sagi Grimberg wrote: > We need to make sure that the cq work item does not > run when we are destroying the cq. Unlike flush_work, > cancel_work_sync protects against self-requeue of the > work item (which we can do in ib_cq_poll_work). > > Signed-off-by: Sagi Grimberg <sagi@grimberg.me> Hi Sagi, I didn't know if this was a theoretical or you actually hit this in practice, so I pulled it for -rc in case it was actually being hit in the wild. Thanks.
diff --git a/drivers/infiniband/core/cq.c b/drivers/infiniband/core/cq.c index e95510117a6d..2746d2eb3d52 100644 --- a/drivers/infiniband/core/cq.c +++ b/drivers/infiniband/core/cq.c @@ -196,7 +196,7 @@ void ib_free_cq(struct ib_cq *cq) irq_poll_disable(&cq->iop); break; case IB_POLL_WORKQUEUE: - flush_work(&cq->work); + cancel_work_sync(&cq->work); break; default: WARN_ON_ONCE(1);
We need to make sure that the cq work item does not run when we are destroying the cq. Unlike flush_work, cancel_work_sync protects against self-requeue of the work item (which we can do in ib_cq_poll_work). Signed-off-by: Sagi Grimberg <sagi@grimberg.me> --- drivers/infiniband/core/cq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)