[PATCH 11/22] mm/mempolicy: don't NUMA-hint folios outside common memory
From: Gregory Price (Meta)
Date: Sat Nov 14 2026 - 02:11:42 EST
The NUMA balancing scanner installs PROT_NONE only on folios that
balancing may migrate.
folio_can_map_prot_numa() already skips ZONE_DEVICE folios. Skip folios
outside the common memory pool (N_MEMORY_COMMON) as well. Do not inject
hint faults on those folios or migrate them.
Convert the zone_device check to a common memory check (which includes
the zone device check explicitly).
All memory is common at this point, so behavior is unchanged.
Signed-off-by: Gregory Price (Meta) <gourry@xxxxxxxxxx>
---
mm/mempolicy.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 662ab420fe03c..619970f0eb954 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -863,7 +863,7 @@ bool folio_can_map_prot_numa(struct folio *folio, struct vm_area_struct *vma,
{
int nid;
- if (!folio || folio_is_zone_device(folio) || folio_test_ksm(folio))
+ if (!folio || !folio_is_common_memory(folio) || folio_test_ksm(folio))
return false;
/* Also skip shared copy-on-write folios */
--
2.53.1-Meta