linux-stable/drivers/infiniband/hw
Jason Gunthorpe f25a546e65 RDMA/odp: Use mmu_interval_notifier_insert()
Replace the internal interval tree based mmu notifier with the new common
mmu_interval_notifier_insert() API. This removes a lot of code and fixes a
deadlock that can be triggered in ODP:

 zap_page_range()
  mmu_notifier_invalidate_range_start()
   [..]
    ib_umem_notifier_invalidate_range_start()
       down_read(&per_mm->umem_rwsem)
  unmap_single_vma()
    [..]
      __split_huge_page_pmd()
        mmu_notifier_invalidate_range_start()
        [..]
           ib_umem_notifier_invalidate_range_start()
              down_read(&per_mm->umem_rwsem)   // DEADLOCK

        mmu_notifier_invalidate_range_end()
           up_read(&per_mm->umem_rwsem)
  mmu_notifier_invalidate_range_end()
     up_read(&per_mm->umem_rwsem)

The umem_rwsem is held across the range_start/end as the ODP algorithm for
invalidate_range_end cannot tolerate changes to the interval
tree. However, due to the nested invalidation regions the second
down_read() can deadlock if there are competing writers. The new core code
provides an alternative scheme to solve this problem.

Fixes: ca748c39ea ("RDMA/umem: Get rid of per_mm->notifier_count")
Link: https://lore.kernel.org/r/20191112202231.3856-6-jgg@ziepe.ca
Tested-by: Artemy Kovalyov <artemyko@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
2019-11-23 19:56:44 -04:00
..
bnxt_re RDMA/bnxt_re: Fix spelling mistake "missin_resp" -> "missing_resp" 2019-09-16 10:58:57 -03:00
cxgb3 RDMA/{cxgb3, cxgb4, i40iw}: Remove common code 2019-08-12 10:19:43 -04:00
cxgb4 RDMA/cxgb4: Do not dma memory off of the stack 2019-10-04 15:13:27 -03:00
efa RDMA/efa: Fix incorrect error print 2019-09-16 14:25:43 -03:00
hfi1 RDMA/hfi1: Prevent memory leak in sdma_init 2019-10-01 11:34:55 -03:00
hns RDMA subsystem updates for 5.4 2019-09-21 10:26:24 -07:00
i40iw RDMA/i40iw: Associate ibdev to netdev before IB device registration 2019-10-04 14:29:14 -03:00
mlx4 Merge tag 'v5.3-rc8' into rdma.git for-next 2019-09-13 16:59:51 -03:00
mlx5 RDMA/odp: Use mmu_interval_notifier_insert() 2019-11-23 19:56:44 -04:00
mthca IB: Remove unneeded memset 2019-07-03 14:26:49 -03:00
ocrdma RDMA: Introduce ib_port_phys_state enum 2019-08-12 10:18:52 -04:00
qedr RDMA: Introduce ib_port_phys_state enum 2019-08-12 10:18:52 -04:00
qib mm/gup: add make_dirty arg to put_user_pages_dirty_lock() 2019-09-24 15:54:08 -07:00
usnic mm/gup: add make_dirty arg to put_user_pages_dirty_lock() 2019-09-24 15:54:08 -07:00
vmw_pvrdma RDMA/vmw_pvrdma: Free SRQ only once 2019-10-01 10:47:58 -03:00
Makefile rdma: Remove nes 2019-06-13 09:59:49 -04:00