Messages in this thread | | | Date | Wed, 3 Jun 2009 16:48:07 +0200 | Subject | Re: [PATCH 3/5] x86: add cpu_node topology detection for AMD Magny-Cours | From | Bert Wesarg <> |
| |
On Wed, Jun 3, 2009 at 16:35, Andreas Herrmann <andreas.herrmann3@amd.com> wrote: > This adapts CPU topology detection for AMD Magny-Cours. > > Here is example output from two cores on same package but different > internal cpu_nodes: > > /sys/devices/system/cpu/cpu5: > physical_package_id : 0 > core_id : 5 > thread_siblings : 00000020 > thread_siblings_list : 5 > cpu_node_id : 0 > cpu_node_siblings : 0000003f > cpu_node_siblings_list : 0-5 > core_siblings : 00000fff > core_siblings_list : 0-11 > /sys/devices/system/cpu/cpu6: > physical_package_id : 0 > core_id : 0 > thread_siblings : 00000040 > thread_siblings_list : 6 > cpu_node_id : 1 > cpu_node_siblings : 00000fc0 > cpu_node_siblings_list : 6-11 > core_siblings : 00000fff > core_siblings_list : 0-11 > > Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com> > --- > arch/x86/include/asm/cpufeature.h | 1 + > arch/x86/kernel/cpu/amd.c | 61 +++++++++++++++++++++++++++++++++++++ > 2 files changed, 62 insertions(+), 0 deletions(-) > > diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c > index 728b375..feed057 100644 > --- a/arch/x86/kernel/cpu/amd.c > +++ b/arch/x86/kernel/cpu/amd.c > @@ -274,7 +328,14 @@ static void __cpuinit srat_detect_node(struct cpuinfo_x86 *c) > int node; > unsigned apicid = cpu_has_apic ? hard_smp_processor_id() : c->apicid; > > +#ifdef CONFIG_MULTI_NODE_CPU > + if (cpu_has(c, X86_FEATURE_AMD_DCM)) > + node = (c->phys_proc_id << 1) + c->cpu_node_id; > + else > + node = c->phys_proc_id; > +#else > node = c->phys_proc_id; > +#endif Stale CONFIG_MULTI_NODE_CPU?
Regards, Bert
> if (apicid_to_node[apicid] != NUMA_NO_NODE) > node = apicid_to_node[apicid]; > if (!node_online(node)) { > -- > 1.6.3.1 > > > > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |