On Sun, Aug 11, 2019 at 06:50:44PM -0700, john.hubbard@xxxxxxxxx wrote:...
From: John Hubbard <jhubbard@xxxxxxxxxx>
diff --git a/drivers/infiniband/core/umem_odp.c b/drivers/infiniband/core/umem_odp.c
index 53085896d718..fdff034a8a30 100644
--- a/drivers/infiniband/core/umem_odp.c
+++ b/drivers/infiniband/core/umem_odp.c
@@ -534,7 +534,7 @@ static int ib_umem_odp_map_dma_single_page(
}
out:
- put_user_page(page);
+ vaddr_unpin_pages(&page, 1, &umem_odp->umem.vaddr_pin);
if (remove_existing_mapping) {
ib_umem_notifier_start_account(umem_odp);
@@ -635,9 +635,10 @@ int ib_umem_odp_map_dma_pages(struct ib_umem_odp *umem_odp, u64 user_virt,
* complex (and doesn't gain us much performance in most use
* cases).
*/
- npages = get_user_pages_remote(owning_process, owning_mm,
+ npages = vaddr_pin_pages_remote(owning_process, owning_mm,
user_virt, gup_num_pages,
- flags, local_page_list, NULL, NULL);
+ flags, local_page_list, NULL, NULL,
+ &umem_odp->umem.vaddr_pin);
Thinking about this part of the patch... is this pin really necessary? This
code is not doing a long term pin. The page just needs a reference while we
map it into the devices page tables. Once that is done we should get notifiers
if anything changes and we can adjust. right?