powerpc: Make core sibling information available to userspace

Previous thread: powerpc/mm: Implement _PAGE_SPECIAL & pte_special() for 64-bit by Linux Kernel Mailing List on Monday, July 28, 2008 - 10:10 am. (1 message)

Next thread: powerpc: Show processor cache information in sysfs by Linux Kernel Mailing List on Monday, July 28, 2008 - 10:10 am. (1 message)
From: Linux Kernel Mailing List
Date: Monday, July 28, 2008 - 10:10 am

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=440a08...
Commit:     440a0857e32a05979fb01fc59ea454a723e80e4b
Parent:     0764bf63da5466474eebf7d21994cf6b106265a3
Author:     Nathan Lynch <ntl@pobox.com>
AuthorDate: Sun Jul 27 15:24:53 2008 +1000
Committer:  Benjamin Herrenschmidt <benh@kernel.crashing.org>
CommitDate: Mon Jul 28 16:30:51 2008 +1000

    powerpc: Make core sibling information available to userspace
    
    Implement the notion of "core siblings" for powerpc.  This makes
    /sys/devices/system/cpu/cpu*/topology/core_siblings present sensible
    values, indicating online CPUs which share an L2 cache.
    
    BenH: Made cpu_to_l2cache() use of_find_node_by_phandle() instead
    of IBM-specific open coded search
    
    Signed-off-by: Nathan Lynch <ntl@pobox.com>
    Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
 arch/powerpc/kernel/smp.c      |   64 ++++++++++++++++++++++++++++++++++++++++
 include/asm-powerpc/smp.h      |    1 +
 include/asm-powerpc/topology.h |    1 +
 3 files changed, 66 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 3c4d07e..f7a2f81 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -63,10 +63,12 @@ struct thread_info *secondary_ti;
 cpumask_t cpu_possible_map = CPU_MASK_NONE;
 cpumask_t cpu_online_map = CPU_MASK_NONE;
 DEFINE_PER_CPU(cpumask_t, cpu_sibling_map) = CPU_MASK_NONE;
+DEFINE_PER_CPU(cpumask_t, cpu_core_map) = CPU_MASK_NONE;
 
 EXPORT_SYMBOL(cpu_online_map);
 EXPORT_SYMBOL(cpu_possible_map);
 EXPORT_PER_CPU_SYMBOL(cpu_sibling_map);
+EXPORT_PER_CPU_SYMBOL(cpu_core_map);
 
 /* SMP operations for this machine */
 struct smp_ops_t *smp_ops;
@@ -230,6 +232,7 @@ void __devinit smp_prepare_boot_cpu(void)
 
 	cpu_set(boot_cpuid, cpu_online_map);
 	cpu_set(boot_cpuid, per_cpu(cpu_sibling_map, boot_cpuid));
+	cpu_set(boot_cpuid, ...
Previous thread: powerpc/mm: Implement _PAGE_SPECIAL & pte_special() for 64-bit by Linux Kernel Mailing List on Monday, July 28, 2008 - 10:10 am. (1 message)

Next thread: powerpc: Show processor cache information in sysfs by Linux Kernel Mailing List on Monday, July 28, 2008 - 10:10 am. (1 message)