Re: [PATCH v11 rdma-next 3/7] RDMA/efa: Use the common mmap_xa helpers

Jason Gunthorpe
2019-09-23T13:28:18Z

On Mon, Sep 23, 2019 at 09:15:54AM +0000, Michal Kalderon wrote:

> > This hidden detail should also be noted in the comment for
> > rdma_user_mmap_io..
>
> I actually misunderstood you before and thought that we want to
> maintain all mappings in umap. Now I understand you meant only the
> io mappings, since they're not referenced counted by the mm system.
> I'll revert the changes and add an additional parameter to
> rdma_user_mmap_io -> However, this means more changes in drivers
> that call this function and don't use the mmap_xa, Should I add an
> additional interface ? or are you OK with me sending NULL to the
> additional parameter from all drivers using the interface ? (hns,
> mlx4, mlx5)

It should be OK

> Also, who should increase the refcnt of rdma_user_mmap_entry when it
> is set to the vma private data ? The caller of rdma_user_mmap_io or
> inside rdma_user_mmap_io function ? This will definitely simplify
> things.

I generally prefer to see refcounts incrd at the spot the pointer is
copied, so the thing that sets vm_prviate_data should incr the refcount.

Jason