Skip to content

nvmet-rdma: Rework the DoS mitigation code

Bart Van Assche linux-nvme 4 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest posting 3/30 of 2 patches 0 repliesNew
  2. v3 posting 2/30 of 2 patches 0 repliesSuperseded
  3. v3 posting 1/32 patches 0 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v22 patches0 repliesSuperseded

Patches in v3 posting 3/3 No applies recorded yet

None of the 2 patches the cover letter announces are in this archive.

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 0/2] nvmet-rdma: Rework the DoS mitigation code
Quoted 1 line · Sagi Grimberg

But are we sure we can't simply resolve the false lockdep complaint?

Hi Sagi,

Although I agree that the code that is currently upstream is fine, it is hard to teach this to lockdep. The flush_workqueue(nvmet_rdma_delete_wq) call waits for all work that has been queued on nvmet_rdma_delete_wq and is called with a CM ID handler mutex held. Work items queued on that work queue lock and unlock the CM ID handler mutex. This is fine because each work queue flush call waits for deletion of previously created CM IDs to finish. I think that teaching this to lockdep would require to model the handler mutex of later created CM IDs as outer locks and the handler mutexes of earlier created CM IDs as inner locks. The 'subclass' argument of the functions in <linux/lockdep.h> represents the locking nesting level. A subclass could be associated with the handler mutex by setting it at CM ID creation time. Since CM IDs associated with logins are created from inside the RDMA CM I'm not sure how to implement this. Additionally, the maximum number of subclasses supported by lockdep is not that high:

#define MAX_LOCKDEP_SUBCLASSES 8UL

It's not clear to me how to model CM ID cleanup as nested locking after more than MAX_LOCKDEP_SUBCLASSES logins.

Since I am not aware of an elegant way to suppress this lockdep complaint without also suppressing useful reports I came up with this patch series.

This patch series brings two additional benefits:
- Lower latency for login due to the removal of a flush_workqueue() call from the login code.
- Removal of a global workqueue.

If you would prefer to implement another solution to get rid of this lockdep complaint, alternative proposals are welcome.

Bart.