Merge tag 'mm-stable-2024-03-13-20-04' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6-microblaze.git] / kernel / sched / fair.c
index 6a16129..03be0d1 100644 (file)
@@ -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.