Re: [PATCH v3 1/7] mm: support promotion-only NUMA hinting scans
From: Gregory Price
Date: Thu Sep 24 2026 - 10:15:36 EST
On Thu, Sep 24, 2026 at 01:45:24PM +0200, David Hildenbrand (Arm) wrote:
> > - Opting VMAs out of scanning because they became inactive obviously
> > breaks tiering - because the intent is to identify when a VMA
> > becomes active. Applying it in tiering modes causes
>
> Incomplete sentence.
>
oi
Applying it in tiering modes causes VMAs to become permanently stranded
on lower tiers.
> >
> > - Opting Read-only file VMAs out of scanning is just incorrect for
> > tiering modes because its intent is to prevent bouncing between
> > sockets (east-west), while tiering controls tier migration
> > (north-south). The result is hot read-only files can overload
> > lower tier bandwidth.
> >
> > Add MM_CP_PROT_NUMA_PROMO_ONLY and let task_numa_work() select the type
> > of walk. Build the change-protection flags there and pass them unchanged
> > through change_prot_numa() so its PTE/PMD paths use the same decision.
> >
> > Have folio_can_map_prot_numa() derive the single-threaded private state at
> > the point of use instead of adding another precomputed boolean to the
> > protection-walk interface. This keeps the interface focused on scan intent
> > and avoids plumbing VMA-derived state beside cp_flags.
> >
> > The tradeoff for the cleaner interface is an atomic mm_users read for each
> > folio, rather than once per PTE range. Check the promotion-only top-tier
> > exclusion bit first as a mild optimization.
> >
> > The scan-intent interface is required by the following memory-tiering
> > fixes and must accompany them when backported.
> >
> > Fixes: c574bbe91703 ("NUMA balancing: optimize page placement for memory tiering system")
> > Cc: stable@xxxxxxxxxxxxxxx
> > Suggested-by: David Hildenbrand <david@xxxxxxxxxx>
> > Link: https://lore.kernel.org/r/4d2853c9-edf4-4685-b186-7214ed6abd84@xxxxxxxxxx
> > Assisted-by: LLM
> > Signed-off-by: Gregory Price (Meta) <gourry@xxxxxxxxxx>
> > ---
>
> LGTM
>
> Acked-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>
>
> --
> Cheers,
>
> David