Re: [PATCHv2] mm/khugepaged: Do not fail collapse_pte_mapped_thp() on SCAN_PMD_NULL
From: Lorenzo Stoakes
Date: Thu Sep 18 2025 - 08:16:31 EST
Sorry mutt hid this reply from me...
On Wed, Sep 17, 2025 at 11:43:08AM +0100, Kiryl Shutsemau wrote:
> On Tue, Sep 16, 2025 at 10:54:12AM +0100, Lorenzo Stoakes wrote:
> > There was a v1 with tags, you've not propagated any of them? Did you feel
> > the change was enough to remove them?
>
> I moved code around and was not comfortable to carry tags over.
Ack.
>
> > Anyway, LGTM so:
> >
> > Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@xxxxxxxxxx>
> >
> > > ---
> > >
> > > v2:
> > > - Modify set_huge_pmd() instead of introducing install_huge_pmd();
> > >
> > > ---
> > > mm/khugepaged.c | 20 +++++++++++++++++++-
> > > 1 file changed, 19 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/mm/khugepaged.c b/mm/khugepaged.c
> > > index b486c1d19b2d..986718599355 100644
> > > --- a/mm/khugepaged.c
> > > +++ b/mm/khugepaged.c
> > > @@ -1472,15 +1472,32 @@ static void collect_mm_slot(struct khugepaged_mm_slot *mm_slot)
> > > static int set_huge_pmd(struct vm_area_struct *vma, unsigned long addr,
> > > pmd_t *pmdp, struct folio *folio, struct page *page)
> > > {
> > > + struct mm_struct *mm = vma->vm_mm;
> > > struct vm_fault vmf = {
> > > .vma = vma,
> > > .address = addr,
> > > .flags = 0,
> > > - .pmd = pmdp,
> > > };
> > > + pgd_t *pgdp;
> > > + p4d_t *p4dp;
> > > + pud_t *pudp;
> > >
> > > mmap_assert_locked(vma->vm_mm);
> >
> > NIT: you have mm as a local var should use here too. Not a big deal though
> > obviously...
>
> Do you want v3 for this?
No, this is not a big deal.