Re: [PATCH 1/8] mm/huge_memory: simplify vma_is_specal_huge()
From: Lorenzo Stoakes (Oracle)
Date: Thu Mar 19 2026 - 06:34:34 EST
On Wed, Mar 18, 2026 at 09:45:31PM +0100, David Hildenbrand (Arm) wrote:
> > +++ 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() ... :)
Could that be a follow up?
I did want to do something where we get the folio and use that to figure things
out, but there's a lot of special cases esp. around DAX that make that tricky.
>
> --
> Cheers,
>
> David
Thanks, Lorenzo