Current fake-numa implementation prevents new Numa
nodes to be later hot-plugged by drivers.
A common symptom of this limitation is the
"node <X> was absent from the node_possible_map"
message by associated warning in mm/memory_hotplug.c:
add_memory_resource().
This comes from the lack of remapping in both
pxm_to_node_map[] and node_to_pxm_map[] tables
to take fake-numa nodes into account and thus
triggers collisions with original and physical nodes
only-mapping that had been determined from BIOS tables.
This patch fixes this by doing the necessary node-ids
translation in both pxm_to_node_map[]/node_to_pxm_map[]
tables.
node_distance[] table has also been fixed accordingly.
Signed-off-by: Bruno Faccini <bfaccini@xxxxxxxxxx>
---
drivers/acpi/numa/srat.c | 86 ++++++++++++++++++++++++++++++++++++
include/acpi/acpi_numa.h | 5 +++
include/linux/numa_memblks.h | 3 ++
mm/numa_emulation.c | 45 ++++++++++++++++---
mm/numa_memblks.c | 2 +-
5 files changed, 133 insertions(+), 8 deletions(-)
diff --git a/drivers/acpi/numa/srat.c b/drivers/acpi/numa/srat.c
index bec0dcd1f9c3..59fffe34c9d0 100644
--- a/drivers/acpi/numa/srat.c
+++ b/drivers/acpi/numa/srat.c
@@ -81,6 +81,92 @@ int acpi_map_pxm_to_node(int pxm)
}
EXPORT_SYMBOL(acpi_map_pxm_to_node);
+#ifdef CONFIG_NUMA_EMU
+/*
+ * Take max_nid - 1 fake-numa nodes into account in both
+ * pxm_to_node_map()/node_to_pxm_map[] tables.
+ */