[Patch v2 8/8] mm/memblock: default region's nid may be MAX_NUMNODES

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On x86, the call flow looks like this:

numa_init()
    memblock_set_node(..., MAX_NUMNODES)
    numa_register_memblks()
        memblock_validate_numa_coverage()

If there is a hole, the nid for this region would stay to be
MAX_NUMNODES. Then memblock_validate_numa_coverage() will miss to report
it.

Signed-off-by: Wei Yang <richard.weiyang@xxxxxxxxx>
---
 mm/memblock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/memblock.c b/mm/memblock.c
index 9b4fa8fea9a2..3f142c787491 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -759,7 +759,7 @@ bool __init_memblock memblock_validate_numa_coverage(unsigned long threshold_byt
 
 	/* calculate lose page */
 	for_each_mem_pfn_range(i, MAX_NUMNODES, &start_pfn, &end_pfn, &nid) {
-		if (nid == NUMA_NO_NODE)
+		if (nid == MAX_NUMNODES || nid == NUMA_NO_NODE)
 			nr_pages += end_pfn - start_pfn;
 	}
 
-- 
2.34.1





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux