@@ -306,7 +306,6 @@ struct ib_umem *ib_umem_get(struct ib_ucontext *context, unsigned long addr,
struct mm_struct *mm;
unsigned long npages;
int ret;
- int i;
unsigned long dma_attrs = 0;
struct scatterlist *sg_cur, *sg_nxt;
unsigned int gup_flags = FOLL_WRITE;
@@ -351,9 +350,6 @@ struct ib_umem *ib_umem_get(struct ib_ucontext *context, unsigned long addr,
return umem;
}
- /* We assume the memory is from hugetlb until proved otherwise */
- umem->hugetlb = 1;
-
page_list = (struct page **) __get_free_page(GFP_KERNEL);
if (!page_list) {
ret = -ENOMEM;
@@ -365,8 +361,6 @@ struct ib_umem *ib_umem_get(struct ib_ucontext *context, unsigned long addr,
* just assume the memory is not hugetlb memory
*/
vma_list = (struct vm_area_struct **) __get_free_page(GFP_KERNEL);
- if (!vma_list)
- umem->hugetlb = 0;
npages = ib_umem_num_pages(umem);
if (npages == 0 || npages > UINT_MAX) {
@@ -414,15 +408,6 @@ struct ib_umem *ib_umem_get(struct ib_ucontext *context, unsigned long addr,
npages -= ret;
ib_umem_add_sg_table(&sg_cur, &sg_nxt, page_list, ret);
-
- /* Continue to hold the mmap_sem as vma_list access
- * needs to be protected.
- */
- for (i = 0; i < ret && umem->hugetlb; i++) {
- if (vma_list && !is_vm_hugetlb_page(vma_list[i]))
- umem->hugetlb = 0;
- }
-
up_read(&mm->mmap_sem);
}
@@ -416,9 +416,6 @@ int ib_umem_odp_get(struct ib_umem_odp *umem_odp, int access)
h = hstate_vma(vma);
umem->page_shift = huge_page_shift(h);
up_read(&mm->mmap_sem);
- umem->hugetlb = 1;
- } else {
- umem->hugetlb = 0;
}
mutex_init(&umem_odp->umem_mutex);
@@ -47,7 +47,6 @@ struct ib_umem {
unsigned long address;
int page_shift;
u32 writable : 1;
- u32 hugetlb : 1;
u32 is_odp : 1;
struct work_struct work;
struct sg_table sg_head;