Re: [PATCH 19/46] hugetlb: add HGM support for follow_hugetlb_page

From: Peter Xu
Date: Thu Jan 05 2023 - 17:27:34 EST


On Thu, Jan 05, 2023 at 10:18:17AM +0000, James Houghton wrote:
> @@ -6649,13 +6655,20 @@ long follow_hugetlb_page(struct mm_struct *mm, struct vm_area_struct *vma,
> */
> if (absent && (flags & FOLL_DUMP) &&
> !hugetlbfs_pagecache_present(h, vma, vaddr)) {
> - if (pte)
> + if (ptep)
> spin_unlock(ptl);
> hugetlb_vma_unlock_read(vma);
> remainder = 0;
> break;
> }
>
> + if (!absent && pte_present(pte) &&
> + !hugetlb_pte_present_leaf(&hpte, pte)) {
> + /* We raced with someone splitting the PTE, so retry. */
> + spin_unlock(ptl);

vma unlock missing here.

> + continue;
> + }

--
Peter Xu