RFC iwarp device removal deadlock fix
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest3 patches 0 repliesNew
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | iw_cm: free cm_id resources on the last deref | +0 | 3 replies | |
| 2/3 | iw_cxgb4: don't block in destroy_qp awaiting the last deref | +0 | 0 replies | |
| 3/3 | nvme-rdma: Fix device removal handlingdrivers/ | +27 | 2 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH RFC 0/3] iwarp device removal deadlock fix
Quoted 3 lines
This RFC series attempts to address the deadlock issue discovered while testing nvmf/rdma handling rdma device removal events from the
rdma_cm.
Thanks for doing this Steve!
Quoted 13 lines
For a discussion of the deadlock that can happen, see
http://lists.infradead.org/pipermail/linux-nvme/2016-July/005440.html.
For my description of the deadlock itself, see this post in the above thread:
http://lists.infradead.org/pipermail/linux-nvme/2016-July/005465.html
In a nutshell,
iw_cxgb4and theiw_cmblock during qp/cm_id destruction until all references are removed. This combined with the iwarp CM passing disconnect events up to therdma_cmduring disconnect and/or qp/cm_id destruction leads to a deadlock.
Quoted 6 lines
My proposed solution is to remove the need for
iw_cxgb4andiw_cmto block during object destruction for the recnts to reach 0, but rather to let the freeing of the object memory be deferred when the last deref is done. This allows all the qps/cm_ids to be destroyed without blocking, and all the object memory freeing ends up happinging when the application'sdevice_removeevent handler function returns to therdma_cm.
This sounds like a very good approach moving forward.
Quoted 8 lines
Sean, I was hoping you could have a look at the
iwcm.cpatch particularly, to tell my why its broken. :) I spent some time trying to figure out why we really need theCALLBACK_DESTROYflag, but I concluded it really isn't needed. The one side effect I see with my change, is that the application could possibly get acm_idevent after it has destroyed thecm_id. There probably is a way to discard events that have a reference on thecm_idbut get processed after the app has destoyed thecm_idby having a new flag indicating "destroyed by app".
That sounds easy enough. Does this mean that iwcm relies on the driver to do this or is it inter-operable with the existing logic? If not this will need to take care of all the iWARP drivers.