linux-stable/drivers/infiniband/hw/mlx5
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
..
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
ah.c RDMA: Handle AH allocations by IB/core 2019-04-08 13:05:25 -03:00
cmd.c net/mlx5: Move device memory management to mlx5_core 2019-09-01 23:44:41 -07:00
cmd.h net/mlx5: Move device memory management to mlx5_core 2019-09-01 23:44:41 -07:00
cong.c infiniband: mlx5: no need to check return value of debugfs_create functions 2019-01-24 09:22:29 -07:00
cq.c RDMA/mlx5: Split sig_err MR data into its own xarray 2019-10-28 16:41:13 -03:00
devx.c RDMA/mlx5: Use a dedicated mkey xarray for ODP 2019-10-28 16:41:13 -03:00
doorbell.c IB/{core,hw}: Have ib_umem_get extract the ib_ucontext from ib_udata 2019-01-10 17:07:45 -07:00
flow.c RDMA subsystem updates for 5.4 2019-09-21 10:26:24 -07:00
gsi.c RDMA, core and ULPs: Declare ib_post_send() and ib_post_recv() arguments const 2018-07-30 20:09:34 -06:00
ib_rep.c Merge mlx5-next into rdma for-next 2019-07-05 10:16:19 -03:00
ib_rep.h Merge mlx5-next into rdma for-next 2019-07-03 16:50:26 -03:00
ib_virt.c
mad.c IB/mlx5: Fixed reporting counters on 2nd port for Dual port RoCE 2019-07-03 15:08:54 -03:00
main.c RDMA/mlx5: Rework implicit ODP destroy 2019-10-28 16:41:14 -03:00
mem.c RDMA/odp: Split creating a umem_odp from ib_umem_get 2019-08-21 14:08:42 -03:00
mlx5_ib.h RDMA/odp: Use mmu_interval_notifier_insert() 2019-11-23 19:56:44 -04:00
mr.c RDMA/odp: Use mmu_interval_notifier_insert() 2019-11-23 19:56:44 -04:00
odp.c RDMA/odp: Use mmu_interval_notifier_insert() 2019-11-23 19:56:44 -04:00
qp.c Merge tag 'v5.3-rc8' into rdma.git for-next 2019-09-13 16:59:51 -03:00
srq.c RDMA: Handle SRQ allocations by IB/core 2019-04-08 13:05:25 -03:00
srq.h RDMA: Handle SRQ allocations by IB/core 2019-04-08 13:05:25 -03:00
srq_cmd.c mlx5: Use refcount_t for refcount 2019-08-07 11:01:48 -07:00