Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm/damon/paddr: use alloc_migartion_target() with no migration fallback nodemask

Patch series "mm/damon: use alloc_migrate_target() for
DAMOS_MIGRATE_{HOT,COLD}".

DAMOS_MIGRATE_{HOT,COLD} implementation resembles that for demotion, and
hence the behavior is also similar to that. But, since those are not only
for demotion but general migrations, it would be better to match with that
for move_pages() system call. Make the implementation and the behavior
more similar to move_pages() by not setting migration fallback nodes, and
using alloc_migration_target() instead of alloc_migrate_folio().

alloc_migrate_folio() was renamed from alloc_demote_folio() and been
non-static function, to let DAMOS_MIGRATE_{HOT,COLD} call it. As
alloc_migration_target() is called instead, the renaming and de-static
changes are no more required but could only make future code readers be
confused. Revert the changes, too.


This patch (of 3):

DAMOS_MIGRATE_{HOT,COLD} implementation resembles that for
demote_folio_list(). Because those are not only for demotion but general
folio migrations, it makes more sense to behave similarly to move_pages()
system call. Make the behavior more similar to move_pages(), by using
alloc_migration_target() instead of alloc_migrate_folio(), without
fallback nodemask.

Link: https://lkml.kernel.org/r/20250616172346.67659-2-sj@kernel.org
Signed-off-by: SeongJae Park <sj@kernel.org>
Reviewed-by: Joshua Hahn <joshua.hahnjy@gmail.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Honggyu Kim <honggyu.kim@sk.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Qi Zheng <zhengqi.arch@bytedance.com>
Cc: Shakeel Butt <shakeel.butt@linux.dev>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

SeongJae Park and committed by
Andrew Morton
b435415e ec3681e8

+1 -3
+1 -3
mm/damon/paddr.c
··· 386 386 int target_nid) 387 387 { 388 388 unsigned int nr_succeeded = 0; 389 - nodemask_t allowed_mask = NODE_MASK_NONE; 390 389 struct migration_target_control mtc = { 391 390 /* 392 391 * Allocate from 'node', or fail quickly and quietly. ··· 395 396 .gfp_mask = (GFP_HIGHUSER_MOVABLE & ~__GFP_RECLAIM) | 396 397 __GFP_NOWARN | __GFP_NOMEMALLOC | GFP_NOWAIT, 397 398 .nid = target_nid, 398 - .nmask = &allowed_mask 399 399 }; 400 400 401 401 if (pgdat->node_id == target_nid || target_nid == NUMA_NO_NODE) ··· 404 406 return 0; 405 407 406 408 /* Migration ignores all cpuset and mempolicy settings */ 407 - migrate_pages(migrate_folios, alloc_migrate_folio, NULL, 409 + migrate_pages(migrate_folios, alloc_migration_target, NULL, 408 410 (unsigned long)&mtc, MIGRATE_ASYNC, MR_DAMON, 409 411 &nr_succeeded); 410 412