Re: [PATCH v3 13/13] mm/huge_memory: add and use has_deposited_pgtable()
From: David Hildenbrand (Arm)
Date: Wed Apr 15 2026 - 12:08:04 EST
>>> 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 :)
--
Cheers,
David