Re: [PATCH 07/13] mm/migrate_device: look up fault folio after a split
From: Lorenzo Stoakes (ARM)
Date: Thu Nov 12 2026 - 15:20:21 EST
On Thu, Nov 12, 2026 at 12:35:23PM -0500, Gregory Price (Meta) wrote:
> On 2026-11-11 18:13 +0000, Lorenzo Stoakes (ARM) wrote:
> > From: Josef Bacik <josef@xxxxxxxxxxxxxx>
> >
> > migrate_vma_collect_pmd() looks up the folio of migrate->fault_page once,
> > when it is entered, at which point the folio is locked.
> >
> > The fault folio is assumed not to change after this, however if
> > migrate_vma_split_folio() splits a PTE-mapped large folio which contains
> > the fault page, the fault page ends up in a different folio.
> >
> > Resolve the issue by looking up fault_folio again after each restart of the
> > walk.
> >
> > Fixes: 022a12deda53 ("mm/migrate_device: handle partially mapped folios during collection")
> > Cc: <stable@xxxxxxxxxxxxxxx>
> > Signed-off-by: Josef Bacik <josef@xxxxxxxxxxxxxx>
> > [ ljs: pared down commit message ]
> > Signed-off-by: Lorenzo Stoakes (ARM) <ljs@xxxxxxxxxx>
>
> Was able to reproduce this, and i think this also reveals (and fixes)
> another bug in Nouveau (memory leak). I think the Nouveau driver still
> needs a patch, but this otherwise looks correct.
I think there was also another in the series that touched nouveau actually
also... worrysome :)
>
> Tested-by: Gregory Price (Meta) <gourry@xxxxxxxxxx>
Thanks! :)
--
Cheers, Lorenzo