Re: [PATCH 1/8] mm/huge_memory: simplify vma_is_specal_huge()

From: David Hildenbrand (Arm)

Date: Wed Mar 18 2026 - 16:45:40 EST


> +++ b/mm/huge_memory.c
> @@ -100,6 +100,14 @@ static inline bool file_thp_enabled(struct vm_area_struct *vma)
> return !inode_is_open_for_write(inode) && S_ISREG(inode->i_mode);
> }
>
> +/* If returns true, we are unable to access the VMA's folios. */
> +static bool vma_is_special_huge(struct vm_area_struct *vma)
> +{
> + if (vma_is_dax(vma))
> + return false;
> + return vma_test_any(vma, VMA_PFNMAP_BIT, VMA_MIXEDMAP_BIT);
> +}

I was hoping that we could make this whole code look more like PTE code
by using vm_normal_page_pmd() ... :)

--
Cheers,

David