put_user_page() question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



John,

With your put_user_page patchset, Is there a reason you don't call
put_user_page() in the 2 spots shown in the diff below?

And Jason, in the second case I find it odd that the driver needs to clear the
invalidate_range() callback prior to the final ib_umem_odp_unmap_dma_pages()
call such that put_user_page() is called.  I am correct that this is how the
pages finally get put in the end?

Ira

diff --git a/drivers/infiniband/core/umem_odp.c b/drivers/infiniband/core/umem_odp.c
index 730b2fa0942e..a63f5eda02ca 100644
--- a/drivers/infiniband/core/umem_odp.c
+++ b/drivers/infiniband/core/umem_odp.c
@@ -687,7 +687,7 @@ int ib_umem_odp_map_dma_pages(struct ib_umem_odp *umem_odp, u64 user_virt,
                if (ret < 0) {
                        /* Release left over pages when handling errors. */
                        for (++j; j < npages; ++j)
-                               put_page(local_page_list[j]);
+                               put_user_page(local_page_list[j]);
                        break;
                }
        }
@@ -750,7 +750,7 @@ void ib_umem_odp_unmap_dma_pages(struct ib_umem_odp *umem_odp, u64 virt,
                        }
                        /* on demand pinning support */
                        if (!umem->context->invalidate_range)
-                               put_page(page);
+                               put_user_page(page);
                        umem_odp->page_list[idx] = NULL;
                        umem_odp->dma_list[idx] = 0;
                        umem->npages--;




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux