Skip to content

Commit

Permalink
mm: numa_clear_kernel_node_hotplug: Add NUMA_NO_NODE check for node id
Browse files Browse the repository at this point in the history
The acquired memory blocks for reserved may include blocks outside of
memory management.  In this case, the nid variable is set to NUMA_NO_NODE
(-1), so an error occurs in node_set().  This adds a check using
numa_valid_node() to numa_clear_kernel_node_hotplug() that skips
node_set() when nid is set to NUMA_NO_NODE.

Link: https://lkml.kernel.org/r/1729070461-13576-1-git-send-email-nobuhiro1.iwamatsu@toshiba.co.jp
Fixes: 8748270 ("mm: introduce numa_memblks")
Signed-off-by: Nobuhiro Iwamatsu <[email protected]>
Reviewed-by: Mike Rapoport (Microsoft) <[email protected]>
Reviewed-by: Anshuman Khandual <[email protected]>
Suggested-by: Yuji Ishikawa <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
iwamatsu-t authored and akpm00 committed Oct 29, 2024
1 parent bc0a2f3 commit d95fb34
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mm/numa_memblks.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ static void __init numa_clear_kernel_node_hotplug(void)
for_each_reserved_mem_region(mb_region) {
int nid = memblock_get_region_node(mb_region);

if (nid != MAX_NUMNODES)
if (numa_valid_node(nid))
node_set(nid, reserved_nodemask);
}

Expand Down

0 comments on commit d95fb34

Please sign in to comment.