Commit 3fb43636 authored by Byungchul Park's avatar Byungchul Park Committed by Andrew Morton
Browse files

sched/numa, mm: do not try to migrate memory to memoryless nodes

Memoryless nodes do not have any memory to migrate to, so, as an
optimization, stop trying it.

Link: https://lkml.kernel.org/r/20240219041920.1183-1-byungchul@sk.com
Link: https://lkml.kernel.org/r/20240216111502.79759-1-byungchul@sk.com


Fixes: c574bbe9 ("NUMA balancing: optimize page placement for memory tiering system")
Signed-off-by: default avatarByungchul Park <byungchul@sk.com>
Reviewed-by: default avatarOscar Salvador <osalvador@suse.de>
Reviewed-by: default avatar"Huang, Ying" <ying.huang@intel.com>
Reviewed-by: default avatarPhil Auld <pauld@redhat.com>
Reviewed-by: default avatarDavidlohr Bueso <dave@stgolabs.net>
Acked-by: default avatarDavid Hildenbrand <david@redhat.com>
Cc: Benjamin Segall <bsegall@google.com>
Cc: Daniel Bristot de Oliveira <bristot@redhat.com>
Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Juri Lelli <juri.lelli@redhat.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Valentin Schneider <vschneid@redhat.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 94ace3fe
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1830,6 +1830,12 @@ bool should_numa_migrate_memory(struct task_struct *p, struct folio *folio,
	int dst_nid = cpu_to_node(dst_cpu);
	int last_cpupid, this_cpupid;

	/*
	 * Cannot migrate to memoryless nodes.
	 */
	if (!node_state(dst_nid, N_MEMORY))
		return false;

	/*
	 * The pages in slow memory node should be migrated according
	 * to hot/cold instead of private/shared.