Skip to content

Fix SDMA/TID caching code

[email protected] linux-rdma 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest16 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/16IB/hfi1: Prevent null pointer dereferencedrivers/infiniband/hw/hfi1/user_sdma.c+1 -10 replies
2/16IB/hfi1: Use the same capability state for all shared contextsdrivers/infiniband/hw/hfi1/chip.c drivers/infiniband/hw/hfi1/chip.h drivers/infiniband/hw/hfi1/file_ops.c +1 more+12 -210 replies
3/16IB/hfi1: Validate SDMA user request indexdrivers/infiniband/hw/hfi1/user_sdma.c+8 -00 replies
4/16IB/hfi1: Validate SDMA user iovector countdrivers/infiniband/hw/hfi1/user_sdma.c+22 -20 replies
5/16IB/hfi1: Release node on insert failuredrivers/infiniband/hw/hfi1/user_sdma.c+1 -00 replies
6/16IB/hfi1: Fix error condition that needs to clean updrivers/infiniband/hw/hfi1/user_sdma.c+2 -10 replies
7/16IB/hfi1: Fix user SDMA racy user request claimdrivers/infiniband/hw/hfi1/user_sdma.c drivers/infiniband/hw/hfi1/user_sdma.h+20 -130 replies
8/16IB/hfi1: Make use of mm consistentdrivers/infiniband/hw/hfi1/file_ops.c drivers/infiniband/hw/hfi1/hfi.h drivers/infiniband/hw/hfi1/mmu_rb.c +5 more+50 -310 replies
9/16IB/hfi1: Make the cache handler own its rb tree rootdrivers/infiniband/hw/hfi1/hfi.h drivers/infiniband/hw/hfi1/mmu_rb.c drivers/infiniband/hw/hfi1/mmu_rb.h +3 more+81 -1250 replies
10/16IB/hfi1: Fix TID caching actionsdrivers/infiniband/hw/hfi1/file_ops.c drivers/infiniband/hw/hfi1/user_exp_rcv.c+11 -90 replies
11/16IB/hfi1: Add evict operation to the mmu rb handlerdrivers/infiniband/hw/hfi1/mmu_rb.c drivers/infiniband/hw/hfi1/mmu_rb.h+38 -00 replies
12/16IB/hfi1: Use evict mmu rb operationdrivers/infiniband/hw/hfi1/user_sdma.c drivers/infiniband/hw/hfi1/user_sdma.h+47 -730 replies
13/16IB/hfi1: Consistently call ops->remove outside spinlockdrivers/infiniband/hw/hfi1/mmu_rb.c drivers/infiniband/hw/hfi1/mmu_rb.h drivers/infiniband/hw/hfi1/user_exp_rcv.c +1 more+84 -230 replies
14/16IB/hfi1: Remove unneeded mm argument in remove functiondrivers/infiniband/hw/hfi1/mmu_rb.c drivers/infiniband/hw/hfi1/mmu_rb.h drivers/infiniband/hw/hfi1/user_exp_rcv.c +1 more+10 -150 replies
15/16IB/hfi1: Fix memory leak during unexpected shutdowndrivers/infiniband/hw/hfi1/user_exp_rcv.c+31 -130 replies
16/16IB/hfi1: Add cache evict LRU listdrivers/infiniband/hw/hfi1/mmu_rb.c+19 -100 replies

Reviews trailers per patch

All 16 patches have a Reviewed-by or Acked-by.

PatchDean LuickIra Weiny
1/16R-b
2/16R-b
3/16R-b
4/16R-b
5/16R-b
6/16R-b
7/16R-b
8/16R-b
9/16R-b
10/16R-b
11/16R-b
12/16R-b
13/16R-b
14/16R-b
15/16R-b
16/16R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 00/16] Fix SDMA/TID caching code

From: Ira Weiny <[email protected]>

This series fixes a number of bugs found while debugging the use of the mm_struct "current->mm". When PSM jobs were stopped unexpectedly (for example control-c) it was possible for the wrong mm struct to be used in mmu_notifier_unregister. This was causing memory corruption. In addition, a number of might sleep conditions were found when mmap_sem needed to be taken while a spinlock was held.

The following are stand alone fixes which can probably be reordered if necessary:

IB/hfi1: Prevent null pointer dereference
IB/hfi1: Use the same capability state for all shared contexts IB/hfi1: Validate SDMA user request index
IB/hfi1: Validate SDMA user iovector count
IB/hfi1: Release node on insert failure
IB/hfi1: Fix error condition that needs to clean up IB/hfi1: Fix user SDMA racy user request claim

The use of mm and locking issues are fixed with the following commits (they depend on the previous commits and must be ordered among themselves):

IB/hfi1: Make use of mm consistent
IB/hfi1: Make the cache handler own its rb tree root IB/hfi1: Fix TID caching actions
IB/hfi1: Add evict operation to the mmu rb handler IB/hfi1: Use evict mmu rb operation
IB/hfi1: Consistently call ops->remove outside spinlock IB/hfi1: Remove unneeded mm argument in remove function IB/hfi1: Fix memory leak during unexpected shutdown IB/hfi1: Add cache evict LRU list

Special thanks to Jim Foraker <[email protected]> for suggestions on how to fix the main issues.

This series requires the clean up patch series sent previously.

Dean Luick (13):
IB/hfi1: Use the same capability state for all shared contexts IB/hfi1: Validate SDMA user request index
IB/hfi1: Validate SDMA user iovector count
IB/hfi1: Release node on insert failure
IB/hfi1: Fix error condition that needs to clean up IB/hfi1: Fix user SDMA racy user request claim IB/hfi1: Make the cache handler own its rb tree root IB/hfi1: Fix TID caching actions
IB/hfi1: Add evict operation to the mmu rb handler IB/hfi1: Use evict mmu rb operation
IB/hfi1: Consistently call ops->remove outside spinlock IB/hfi1: Remove unneeded mm argument in remove function IB/hfi1: Add cache evict LRU list

Ira Weiny (3):
IB/hfi1: Prevent null pointer dereference IB/hfi1: Make use of mm consistent
IB/hfi1: Fix memory leak during unexpected shutdown

 drivers/infiniband/hw/hfi1/chip.c         |   8 --
 drivers/infiniband/hw/hfi1/chip.h         |   2 -
 drivers/infiniband/hw/hfi1/file_ops.c     |  31 ++--
 drivers/infiniband/hw/hfi1/hfi.h          |  13 +-
 drivers/infiniband/hw/hfi1/mmu_rb.c       | 214 ++++++++++++++++++---------
 drivers/infiniband/hw/hfi1/mmu_rb.h       |  32 +++--
 drivers/infiniband/hw/hfi1/user_exp_rcv.c | 115 ++++++++-------
 drivers/infiniband/hw/hfi1/user_pages.c   |  19 +--
 drivers/infiniband/hw/hfi1/user_sdma.c    | 230 +++++++++++++++---------------
 drivers/infiniband/hw/hfi1/user_sdma.h    |   8 +-
 10 files changed, 386 insertions(+), 286 deletions(-)
Signature · 6 lines
1.8.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html