diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2010-05-17 04:00:12 -0400 |
---|---|---|
committer | Martin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com> | 2010-05-17 04:00:16 -0400 |
commit | 10d3858950557cd3cc05f647ede597114c610177 (patch) | |
tree | 5f434f31fb64ef02dc91f99fd895c186379f2b9d | |
parent | 2dedf0d9eadf39660f2e1686b5d36e4a7515803f (diff) |
[S390] topology: expose core identifier
Provide a topology_core_id define which makes sure that the contents of
/sys/devices/system/cpu/cpuX/topology/core_id
indeed do contain the core id and not always 0.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-rw-r--r-- | arch/s390/include/asm/topology.h | 2 | ||||
-rw-r--r-- | arch/s390/kernel/topology.c | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/arch/s390/include/asm/topology.h b/arch/s390/include/asm/topology.h index 6e7211abd950..dc8a67297d0f 100644 --- a/arch/s390/include/asm/topology.h +++ b/arch/s390/include/asm/topology.h | |||
@@ -7,8 +7,10 @@ | |||
7 | 7 | ||
8 | const struct cpumask *cpu_coregroup_mask(unsigned int cpu); | 8 | const struct cpumask *cpu_coregroup_mask(unsigned int cpu); |
9 | 9 | ||
10 | extern unsigned char cpu_core_id[NR_CPUS]; | ||
10 | extern cpumask_t cpu_core_map[NR_CPUS]; | 11 | extern cpumask_t cpu_core_map[NR_CPUS]; |
11 | 12 | ||
13 | #define topology_core_id(cpu) (cpu_core_id[cpu]) | ||
12 | #define topology_core_cpumask(cpu) (&cpu_core_map[cpu]) | 14 | #define topology_core_cpumask(cpu) (&cpu_core_map[cpu]) |
13 | 15 | ||
14 | int topology_set_cpu_management(int fc); | 16 | int topology_set_cpu_management(int fc); |
diff --git a/arch/s390/kernel/topology.c b/arch/s390/kernel/topology.c index 247b4c2d1e51..bcef00766a64 100644 --- a/arch/s390/kernel/topology.c +++ b/arch/s390/kernel/topology.c | |||
@@ -37,7 +37,8 @@ struct tl_cpu { | |||
37 | }; | 37 | }; |
38 | 38 | ||
39 | struct tl_container { | 39 | struct tl_container { |
40 | unsigned char reserved[8]; | 40 | unsigned char reserved[7]; |
41 | unsigned char id; | ||
41 | }; | 42 | }; |
42 | 43 | ||
43 | union tl_entry { | 44 | union tl_entry { |
@@ -58,6 +59,7 @@ struct tl_info { | |||
58 | 59 | ||
59 | struct core_info { | 60 | struct core_info { |
60 | struct core_info *next; | 61 | struct core_info *next; |
62 | unsigned char id; | ||
61 | cpumask_t mask; | 63 | cpumask_t mask; |
62 | }; | 64 | }; |
63 | 65 | ||
@@ -73,6 +75,7 @@ static DECLARE_WORK(topology_work, topology_work_fn); | |||
73 | static DEFINE_SPINLOCK(topology_lock); | 75 | static DEFINE_SPINLOCK(topology_lock); |
74 | 76 | ||
75 | cpumask_t cpu_core_map[NR_CPUS]; | 77 | cpumask_t cpu_core_map[NR_CPUS]; |
78 | unsigned char cpu_core_id[NR_CPUS]; | ||
76 | 79 | ||
77 | static cpumask_t cpu_coregroup_map(unsigned int cpu) | 80 | static cpumask_t cpu_coregroup_map(unsigned int cpu) |
78 | { | 81 | { |
@@ -116,6 +119,7 @@ static void add_cpus_to_core(struct tl_cpu *tl_cpu, struct core_info *core) | |||
116 | for_each_present_cpu(lcpu) { | 119 | for_each_present_cpu(lcpu) { |
117 | if (cpu_logical_map(lcpu) == rcpu) { | 120 | if (cpu_logical_map(lcpu) == rcpu) { |
118 | cpu_set(lcpu, core->mask); | 121 | cpu_set(lcpu, core->mask); |
122 | cpu_core_id[lcpu] = core->id; | ||
119 | smp_cpu_polarization[lcpu] = tl_cpu->pp; | 123 | smp_cpu_polarization[lcpu] = tl_cpu->pp; |
120 | } | 124 | } |
121 | } | 125 | } |
@@ -158,6 +162,7 @@ static void tl_to_cores(struct tl_info *info) | |||
158 | break; | 162 | break; |
159 | case 1: | 163 | case 1: |
160 | core = core->next; | 164 | core = core->next; |
165 | core->id = tle->container.id; | ||
161 | break; | 166 | break; |
162 | case 0: | 167 | case 0: |
163 | add_cpus_to_core(&tle->cpu, core); | 168 | add_cpus_to_core(&tle->cpu, core); |