Re: [PATCH v3 13/13] mm/huge_memory: add and use has_deposited_pgtable()

From: Yin Tirui

Date: Wed Apr 15 2026 - 21:33:22 EST




On 4/16/26 00:06, David Hildenbrand (Arm) wrote:
>
>>>> Then, when we encounter a huge PMD, we know for sure whether it was
>>>> installed through remap_pfn_range() (needs a deposited pgtable) or
>>>> ->huge_fault() (no deposit needed, can be refaulted).
>>>>
>>>> So for Lorenzo's `has_deposited_pgtable()` helper, we could simply use:
>>>>
>>>>     /* Huge PFN map without a huge_fault handler must deposit */
>>>>     if (vma_test(vma, VMA_PFNMAP_BIT))
>>>>         return !vma->vm_ops || !vma->vm_ops->huge_fault;
>>> As mentioned above, also considering vma->vm_ops->fault;
>>
>>
>> Will do.
>
>
> Please make sure to wrap such a check in a well named and good
> documented helper function :)
>
>

Sure! Will introduce a helper for this. Thanks!

--
Yin Tirui