During code review, I found we may leave some reserved region with invalid nid when memblock_set_node() double the array. The patch set propose a fix and test case. Also I found memblock_set_node() accept size instead of end as second parameter. Currently it is misused. Patch 1: fix the second argument passed to memblock_set_node() Patch 2: fix the invalid node id we may have in memmap_init_reserved_pages() Patch 3: add a test case to verify it Wei Yang (3): mm/memblock: pass size instead of end to memblock_set_node() mm/memblock: repeat setting reserved region nid if array is doubled memblock tests: add test for memblock_set_node mm/memblock.c | 14 +++- tools/testing/memblock/tests/basic_api.c | 102 +++++++++++++++++++++++ 2 files changed, 115 insertions(+), 1 deletion(-) -- 2.34.1