Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm/damon: prevent migration fallback to non-target nodes
@ 2026-07-08  8:07 zjh
  2026-07-08 14:11 ` SJ Park
  0 siblings, 1 reply; 5+ messages in thread
From: zjh @ 2026-07-08  8:07 UTC (permalink / raw)
  To: SJ Park, Andrew Morton; +Cc: zjh, damon, linux-mm, linux-kernel

DAMOS_MIGRATE_{HOT,COLD} passes a target NUMA node to migrate_pages().
But alloc_migration_target() treats mtc->nid as a preferred node unless
__GFP_THISNODE is set.  Hence target allocation can fall back to another
node, and migrate_pages() can report success without placing the folio on
the requested target node.

Make DAMON migration target allocation strict by setting __GFP_THISNODE.
This is consistent with alloc_misplaced_dst_folio() and
alloc_demote_folio(), which also use __GFP_THISNODE for migrations to an
explicit destination node.

Signed-off-by: zjh <jiahuitry@outlook.com>
---
 mm/damon/ops-common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/damon/ops-common.c b/mm/damon/ops-common.c
index 6bdd1cfd3863..d21b106b81ca 100644
--- a/mm/damon/ops-common.c
+++ b/mm/damon/ops-common.c
@@ -311,7 +311,7 @@ static unsigned int __damon_migrate_folio_list(
 		 * instead of migrated.
 		 */
 		.gfp_mask = (GFP_HIGHUSER_MOVABLE & ~__GFP_RECLAIM) |
-			__GFP_NOMEMALLOC | GFP_NOWAIT,
+			__GFP_NOMEMALLOC | GFP_NOWAIT | __GFP_THISNODE,
 		.nid = target_nid,
 	};
 

base-commit: 42db70db0bf4f1aa4eac4ddbe121143131b793df
-- 
2.53.0



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-07-09  6:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-08  8:07 [PATCH] mm/damon: prevent migration fallback to non-target nodes zjh
2026-07-08 14:11 ` SJ Park
2026-07-08 17:55   ` Jiahui Zhang
2026-07-09  0:37     ` SJ Park
2026-07-09  6:38       ` Jiahui Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox