Re: [PATCH v4 13/20] mm/migrate: calculate large folio page index using PFN
From: David Hildenbrand (Arm)
Date: Tue Aug 11 2026 - 13:01:03 EST
On 8/6/26 22:21, Lorenzo Stoakes (ARM) wrote:
> Rather than having to figure out the page index to use using
> linear_page_index(), calculate it using PFN.
>
> This is a more natural fit as the linear page index is immaterial to
> determining the folio page index.
>
> Derive the page index from the offset between migration entry PFN and folio
> PFN - pvmw.pfn (set via DEFINE_FOLIO_VMA_WALK() which uses folio_pfn() to
> obtain it).
>
> Additionally remove a not so useful comment and clean the code layout up.
>
> No functional change intended.
>
> Suggested-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>
> Signed-off-by: Lorenzo Stoakes (ARM) <ljs@xxxxxxxxxx>
> ---
Acked-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>
--
Cheers,
David