Re: [PATCH v4 9/9] mm/hugetlb: Introduce hugetlb_walk()

From: David Hildenbrand
Date: Fri Dec 16 2022 - 11:14:08 EST


On 16.12.22 16:52, 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.

Document the last special case in the page_vma_mapped_walk() path where we
don't need any more lock to call hugetlb_walk().

That looks cleaner and the lock assertions are IMHO a very good idea.

Reviewed-by: David Hildenbrand <david@xxxxxxxxxx>


--
Thanks,

David / dhildenb