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>
This commit is contained in:
Nathan Lynch 2008-07-27 15:24:53 +10:00 • committed by Benjamin Herrenschmidt
commit 440a0857e3
3 changed files with 66 additions and 0 deletions

View file

@ -62,6 +62,7 @@ extern int smp_hw_index[];
#endif
DECLARE_PER_CPU(cpumask_t, cpu_sibling_map);
DECLARE_PER_CPU(cpumask_t, cpu_core_map);
/* Since OpenPIC has only 4 IPIs, we use slightly different message numbers.
*

View file

@ -108,6 +108,7 @@ static inline void sysfs_remove_device_from_node(struct sys_device *dev,
#include <asm/smp.h>
#define topology_thread_siblings(cpu) (per_cpu(cpu_sibling_map, cpu))
#define topology_core_siblings(cpu) (per_cpu(cpu_core_map, cpu))
#endif
#endif