Re: [PATCH v2 09/10] mm/hugetlb: Introduce hugetlb_walk()

Mike Kravetz
2022-12-07T22:30:27Z

On 12/07/22 15:31, Peter Xu wrote:
> huge_pte_offset() is the main walker function for hugetlb pgtables. The
> name is not really representing what it does, though.
>
> Instead of renaming it, introduce a wrapper function called hugetlb_walk()
> which will use huge_pte_offset() inside. Assert on the locks when walking
> the pgtable.
>
> Note, the vma lock assertion will be a no-op for private mappings.
>
> Signed-off-by: Peter Xu <peterx@redhat.com>
> ---
> fs/hugetlbfs/inode.c | 4 +---
> fs/userfaultfd.c | 6 ++----
> include/linux/hugetlb.h | 39 +++++++++++++++++++++++++++++++++++++++
> mm/hugetlb.c | 32 +++++++++++++-------------------
> mm/page_vma_mapped.c | 2 +-
> mm/pagewalk.c | 4 +---
> 6 files changed, 57 insertions(+), 30 deletions(-)

Thanks! I like the lockdep checks in hugetlb_walk.

Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>

--
Mike Kravetz