[PATCH 25/60] mm/mempolicy: queue only common memory for mbind() and migrate_pages()
From: Gregory Price via B4 Relay
Date: Fri Nov 20 2026 - 13:26:06 EST
From: "Gregory Price (Meta)" <gourry@xxxxxxxxxx>
mbind(MPOL_MF_MOVE) and migrate_pages() queue folios from a task's
mappings for migration.
Queue only folios on common memory: convert the ZONE_DEVICE checks to
folio_is_common_memory(). As with ZONE_DEVICE folios, the skipped folios
do not count as failures, so MPOL_MF_STRICT does not report them.
Signed-off-by: Gregory Price (Meta) <gourry@xxxxxxxxxx>
---
mm/mempolicy.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 07d577aca78c..e208018499d6 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -687,7 +687,7 @@ static void queue_folios_pmd(pmd_t *pmd, unsigned long addr,
return;
}
folio = vm_normal_folio_pmd(walk->vma, addr, pmdval);
- if (!folio || folio_is_zone_device(folio))
+ if (!folio || !folio_is_common_memory(folio))
return;
if (!queue_folio_required(folio, qp))
return;
@@ -745,7 +745,7 @@ static int queue_folios_pte_range(pmd_t *pmd, unsigned long addr,
continue;
}
folio = vm_normal_folio(vma, addr, ptent);
- if (!folio || folio_is_zone_device(folio))
+ if (!folio || !folio_is_common_memory(folio))
continue;
if (folio_test_large(folio) && max_nr != 1)
nr = folio_pte_batch(folio, pte, ptent, max_nr);
--
2.56.1