Messages in this thread | | | From | James Houghton <> | Date | Thu, 12 Jan 2023 13:06:07 -0500 | Subject | Re: [PATCH 19/46] hugetlb: add HGM support for follow_hugetlb_page |
| |
On Thu, Jan 12, 2023 at 1:02 PM Peter Xu <peterx@redhat.com> wrote: > > On Thu, Jan 05, 2023 at 10:18:17AM +0000, James Houghton wrote: > > @@ -6731,22 +6746,22 @@ long follow_hugetlb_page(struct mm_struct *mm, struct vm_area_struct *vma, > > * and skip the same_page loop below. > > */ > > if (!pages && !vmas && !pfn_offset && > > - (vaddr + huge_page_size(h) < vma->vm_end) && > > - (remainder >= pages_per_huge_page(h))) { > > - vaddr += huge_page_size(h); > > - remainder -= pages_per_huge_page(h); > > - i += pages_per_huge_page(h); > > + (vaddr + pages_per_hpte < vma->vm_end) && > > + (remainder >= pages_per_hpte)) { > > + vaddr += pages_per_hpte; > > This silently breaks hugetlb GUP.. should be > > vaddr += hugetlb_pte_size(&hpte); > > It caused misterious MISSING events when I'm playing with this tree, and > I'm surprised it rooted here. So far the most time consuming one. :)
Thanks Peter!! And the `vaddr + pages_per_hpte < vma->vm_end` should be `vaddr + hugetlb_pte_size(&hpte) < vma->vm_end` too.
| |