]> git.baikalelectronics.ru Git - kernel.git/commitdiff
mm: make free_area_init_node aware of memory less nodes
authorMichal Hocko <mhocko@suse.com>
Tue, 22 Mar 2022 21:47:03 +0000 (14:47 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 22 Mar 2022 22:57:10 +0000 (15:57 -0700)
free_area_init_node is also called from memory less node initialization
path (free_area_init_memoryless_node).  It doesn't really make much sense
to display the physical memory range for those nodes: Initmem setup node
XX [mem 0x0000000000000000-0x0000000000000000]

Instead be explicit that the node is memoryless: Initmem setup node XX as
memoryless

Link: https://lkml.kernel.org/r/20220127085305.20890-6-mhocko@kernel.org
Signed-off-by: Michal Hocko <mhocko@suse.com>
Acked-by: Rafael Aquini <raquini@redhat.com>
Acked-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Mike Rapoport <rppt@linux.ibm.com>
Reviewed-by: Oscar Salvador <osalvador@suse.de>
Cc: Alexey Makhalov <amakhalov@vmware.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Dennis Zhou <dennis@kernel.org>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Nico Pache <npache@redhat.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Wei Yang <richard.weiyang@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/page_alloc.c

index d32a635f2c72b3d822fb6811e76a4479eae03426..584ed4bac85efaef905c42f5171f2a2ef3052912 100644 (file)
@@ -7642,9 +7642,14 @@ static void __init free_area_init_node(int nid)
        pgdat->node_start_pfn = start_pfn;
        pgdat->per_cpu_nodestats = NULL;
 
-       pr_info("Initmem setup node %d [mem %#018Lx-%#018Lx]\n", nid,
-               (u64)start_pfn << PAGE_SHIFT,
-               end_pfn ? ((u64)end_pfn << PAGE_SHIFT) - 1 : 0);
+       if (start_pfn != end_pfn) {
+               pr_info("Initmem setup node %d [mem %#018Lx-%#018Lx]\n", nid,
+                       (u64)start_pfn << PAGE_SHIFT,
+                       end_pfn ? ((u64)end_pfn << PAGE_SHIFT) - 1 : 0);
+       } else {
+               pr_info("Initmem setup node %d as memoryless\n", nid);
+       }
+
        calculate_node_totalpages(pgdat, start_pfn, end_pfn);
 
        alloc_node_mem_map(pgdat);