Re: [PATCH v2 07/13] mm/migrate_device: look up fault folio after a split

From: David Hildenbrand (Arm)

Date: Wed Nov 18 2026 - 10:32:23 EST


On 11/13/26 22:45, 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 ]
> Tested-by: Gregory Price (Meta) <gourry@xxxxxxxxxx>
> Signed-off-by: Lorenzo Stoakes (ARM) <ljs@xxxxxxxxxx>
> ---

Acked-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>

--
Cheers,

David