RDMA/efa: Do not delay freeing of DMA pages
authorGal Pressman <galpress@amazon.com>
Tue, 25 Feb 2020 11:40:10 +0000 (13:40 +0200)
committerJason Gunthorpe <jgg@mellanox.com>
Fri, 28 Feb 2020 16:12:12 +0000 (12:12 -0400)
commitff6629f88c529b07d9704c656c64dae76910e3e9
tree47a5f341063853a8c0c227d44ca9dc28f98d9f13
parent56a7a721dd54fc8cead3d0eeeec4336db24b00fa
RDMA/efa: Do not delay freeing of DMA pages

When destroying a DMA mmapped object, there is no need to artificially
delay the freeing of the pages to the mmap entry removal.  Since the vma
keeps a reference count on these pages, free_pages_exact can be called on
the destroy verb as it won't really free the pages until the reference
count is cleared (in case the user hasn't called munmap yet).

Remove the special handling of DMA pages and call free_pages_exact on
destroy_qp/cq. The mmap entry removal is moved to the beginning of the
destroy flows, so the driver can safely free the pages.

Link: https://lore.kernel.org/r/20200225114010.21790-4-galpress@amazon.com
Reviewed-by: Firas JahJah <firasj@amazon.com>
Reviewed-by: Yossi Leybovich <sleybo@amazon.com>
Signed-off-by: Gal Pressman <galpress@amazon.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/efa/efa_verbs.c