Merge branch 'odp_fixes' into hmm.git
authorJason Gunthorpe <jgg@mellanox.com>
Wed, 21 Aug 2019 17:12:29 +0000 (14:12 -0300)
committerJason Gunthorpe <jgg@mellanox.com>
Wed, 21 Aug 2019 23:58:18 +0000 (20:58 -0300)
From rdma.git

Jason Gunthorpe says:

====================
This is a collection of general cleanups for ODP to clarify some of the
flows around umem creation and use of the interval tree.
====================

The branch is based on v5.3-rc5 due to dependencies, and is being taken
into hmm.git due to dependencies in the next patches.

* odp_fixes:
  RDMA/mlx5: Use odp instead of mr->umem in pagefault_mr
  RDMA/mlx5: Use ib_umem_start instead of umem.address
  RDMA/core: Make invalidate_range a device operation
  RDMA/odp: Use kvcalloc for the dma_list and page_list
  RDMA/odp: Check for overflow when computing the umem_odp end
  RDMA/odp: Provide ib_umem_odp_release() to undo the allocs
  RDMA/odp: Split creating a umem_odp from ib_umem_get
  RDMA/odp: Make the three ways to create a umem_odp clear
  RMDA/odp: Consolidate umem_odp initialization
  RDMA/odp: Make it clearer when a umem is an implicit ODP umem
  RDMA/odp: Iterate over the whole rbtree directly
  RDMA/odp: Use the common interval tree library instead of generic
  RDMA/mlx5: Fix MR npages calculation for IB_ACCESS_HUGETLB

Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
1  2 
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
include/linux/mm_types.h
kernel/fork.c
mm/memremap.c
mm/migrate.c

Simple merge
diff --cc kernel/fork.c
Simple merge
diff --cc mm/memremap.c
@@@ -94,10 -91,18 +94,16 @@@ static void dev_pagemap_cleanup(struct 
                wait_for_completion(&pgmap->done);
                percpu_ref_exit(pgmap->ref);
        }
+       /*
+        * Undo the pgmap ref assignment for the internal case as the
+        * caller may re-enable the same pgmap.
+        */
+       if (pgmap->ref == &pgmap->internal_ref)
+               pgmap->ref = NULL;
  }
  
 -static void devm_memremap_pages_release(void *data)
 +void memunmap_pages(struct dev_pagemap *pgmap)
  {
 -      struct dev_pagemap *pgmap = data;
 -      struct device *dev = pgmap->dev;
        struct resource *res = &pgmap->res;
        unsigned long pfn;
        int nid;
diff --cc mm/migrate.c
Simple merge