Skip to content

Commit 4c80187

Browse files
bfacciniakpm00
authored andcommitted
mm/fake-numa: handle cases with no SRAT info
Handle more gracefully cases where no SRAT information is available, like in VMs with no Numa support, and allow fake-numa configuration to complete successfully in these cases Link: https://lkml.kernel.org/r/20250127171623.1523171-1-bfaccini@nvidia.com Fixes: 63db817 (“mm/fake-numa: allow later numa node hotplug”) Signed-off-by: Bruno Faccini <bfaccini@nvidia.com> Cc: David Hildenbrand <david@redhat.com> Cc: Hyeonggon Yoo <hyeonggon.yoo@sk.com> Cc: John Hubbard <jhubbard@nvidia.com> Cc: Len Brown <lenb@kernel.org> Cc: "Mike Rapoport (IBM)" <rppt@kernel.org> Cc: "Rafael J. Wysocki" <rafael@kernel.org> Cc: Zi Yan <ziy@nvidia.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent 488b5b9 commit 4c80187

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

drivers/acpi/numa/srat.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,13 @@ int __init fix_pxm_node_maps(int max_nid)
9595
int i, j, index = -1, count = 0;
9696
nodemask_t nodes_to_enable;
9797

98-
if (numa_off || srat_disabled())
98+
if (numa_off)
9999
return -1;
100100

101+
/* no or incomplete node/PXM mapping set, nothing to do */
102+
if (srat_disabled())
103+
return 0;
104+
101105
/* find fake nodes PXM mapping */
102106
for (i = 0; i < MAX_NUMNODES; i++) {
103107
if (node_to_pxm_map[i] != PXM_INVAL) {
@@ -117,6 +121,11 @@ int __init fix_pxm_node_maps(int max_nid)
117121
}
118122
}
119123
}
124+
if (index == -1) {
125+
pr_debug("No node/PXM mapping has been set\n");
126+
/* nothing more to be done */
127+
return 0;
128+
}
120129
if (WARN(index != max_nid, "%d max nid when expected %d\n",
121130
index, max_nid))
122131
return -1;

0 commit comments

Comments
 (0)