Re: [PATCH 1/3] mm/memory: Change vmf_anon_prepare() to be non-static

From: Vishal Moola
Date: Wed Feb 21 2024 - 11:49:53 EST


On Tue, Feb 20, 2024 at 7:36 PM Matthew Wilcox <willy@xxxxxxxxxxxxx> wrote:
>
> On Tue, Feb 20, 2024 at 03:14:22PM -0800, Vishal Moola (Oracle) wrote:
> > In order to handle hugetlb faults under the VMA lock, hugetlb can use
> > vmf_anon_prepare() to ensure we can safely prepare an anon_vma. Change
> > it to be a non-static function so it can be used within hugetlb as well.
>
> I think the prototype for this should probably live in mm/internal.h?

That does make more sense, I'll move it for v2.

> > +++ b/include/linux/hugetlb.h
> > @@ -272,6 +272,7 @@ void hugetlb_vma_unlock_write(struct vm_area_struct *vma);
> > int hugetlb_vma_trylock_write(struct vm_area_struct *vma);
> > void hugetlb_vma_assert_locked(struct vm_area_struct *vma);
> > void hugetlb_vma_lock_release(struct kref *kref);
> > +vm_fault_t vmf_anon_prepare(struct vm_fault *vmf);
> >
> > int pmd_huge(pmd_t pmd);
> > int pud_huge(pud_t pud);
> >