|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH v3 06/22] xen/arm: Map populated CPUs to their respective NUMA nodes
Map the populated CPUs to their respective NUMA nodes. The NUMA
node ID for each CPU is retrieved from the Device Tree.
Signed-off-by: Hirokazu Takahashi <taka@xxxxxxxxxxxxx>
---
xen/arch/arm/smpboot.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index d1651fe7dd..23c5a46757 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -133,6 +133,9 @@ static void __init dt_smp_init_cpus(void)
};
bool bootcpu_valid = false;
int rc;
+#ifdef CONFIG_DEVICE_TREE_NUMA
+ static nodeid_t __initdata cpu_to_numa[NR_CPUS];
+#endif /* CONFIG_DEVICE_TREE_NUMA */
mpidr = system_cpuinfo.mpidr.bits & MPIDR_HWID_MASK;
@@ -244,6 +247,17 @@ static void __init dt_smp_init_cpus(void)
}
else
tmp_map[i] = hwid;
+
+#ifdef CONFIG_DEVICE_TREE_NUMA
+ if ( tmp_map[i] != MPIDR_INVALID )
+ {
+ uint32_t nid;
+ if ( numa_disabled()
+ || !dt_property_read_u32(cpu, "numa-node-id", &nid) )
+ nid = 0U; /* default node */
+ cpu_to_numa[i] = nid >= MAX_NUMNODES ? 0U : nid;
+ }
+#endif /* CONFIG_DEVICE_TREE_NUMA */
}
if ( !bootcpu_valid )
@@ -259,6 +273,10 @@ static void __init dt_smp_init_cpus(void)
continue;
cpumask_set_cpu(i, &cpu_possible_map);
cpu_logical_map(i) = tmp_map[i];
+#ifdef CONFIG_DEVICE_TREE_NUMA
+ numa_set_node(i, cpu_to_numa[i]);
+ numa_add_cpu(i);
+#endif /* CONFIG_DEVICE_TREE_NUMA */
}
}
--
2.43.0
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |