diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2012-11-12 04:03:25 -0500 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2012-11-23 05:14:31 -0500 |
commit | d1e57508fbd63b340788afe6f2c74a608603e714 (patch) | |
tree | a4f32399d06ea644f3a6cb6f02b87ad9082b3bb6 /arch/s390/include | |
parent | 0a4ccc992978ef552dc86ac68bc1ec62cf268e2a (diff) |
s390/topology: cleanup topology code
Mainly merge all different per-cpu arrays into a single array which
holds all topology information per logical cpu.
Also fix the broken core vs socket variable naming and simplify the
locking a bit.
When running in environments without topology information also
invent book, socket and core ids, so that not all ids are zero.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/include')
-rw-r--r-- | arch/s390/include/asm/topology.h | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/arch/s390/include/asm/topology.h b/arch/s390/include/asm/topology.h index 9935cbd6a46f..05425b18c0aa 100644 --- a/arch/s390/include/asm/topology.h +++ b/arch/s390/include/asm/topology.h | |||
@@ -8,32 +8,34 @@ struct cpu; | |||
8 | 8 | ||
9 | #ifdef CONFIG_SCHED_BOOK | 9 | #ifdef CONFIG_SCHED_BOOK |
10 | 10 | ||
11 | extern unsigned char cpu_socket_id[NR_CPUS]; | 11 | struct cpu_topology_s390 { |
12 | #define topology_physical_package_id(cpu) (cpu_socket_id[cpu]) | 12 | unsigned short core_id; |
13 | unsigned short socket_id; | ||
14 | unsigned short book_id; | ||
15 | cpumask_t core_mask; | ||
16 | cpumask_t book_mask; | ||
17 | }; | ||
18 | |||
19 | extern struct cpu_topology_s390 cpu_topology[NR_CPUS]; | ||
20 | |||
21 | #define topology_physical_package_id(cpu) (cpu_topology[cpu].socket_id) | ||
22 | #define topology_core_id(cpu) (cpu_topology[cpu].core_id) | ||
23 | #define topology_core_cpumask(cpu) (&cpu_topology[cpu].core_mask) | ||
24 | #define topology_book_id(cpu) (cpu_topology[cpu].book_id) | ||
25 | #define topology_book_cpumask(cpu) (&cpu_topology[cpu].book_mask) | ||
13 | 26 | ||
14 | extern unsigned char cpu_core_id[NR_CPUS]; | 27 | #define mc_capable() 1 |
15 | extern cpumask_t cpu_core_map[NR_CPUS]; | ||
16 | 28 | ||
17 | static inline const struct cpumask *cpu_coregroup_mask(int cpu) | 29 | static inline const struct cpumask *cpu_coregroup_mask(int cpu) |
18 | { | 30 | { |
19 | return &cpu_core_map[cpu]; | 31 | return &cpu_topology[cpu].core_mask; |
20 | } | 32 | } |
21 | 33 | ||
22 | #define topology_core_id(cpu) (cpu_core_id[cpu]) | ||
23 | #define topology_core_cpumask(cpu) (&cpu_core_map[cpu]) | ||
24 | #define mc_capable() (1) | ||
25 | |||
26 | extern unsigned char cpu_book_id[NR_CPUS]; | ||
27 | extern cpumask_t cpu_book_map[NR_CPUS]; | ||
28 | |||
29 | static inline const struct cpumask *cpu_book_mask(int cpu) | 34 | static inline const struct cpumask *cpu_book_mask(int cpu) |
30 | { | 35 | { |
31 | return &cpu_book_map[cpu]; | 36 | return &cpu_topology[cpu].book_mask; |
32 | } | 37 | } |
33 | 38 | ||
34 | #define topology_book_id(cpu) (cpu_book_id[cpu]) | ||
35 | #define topology_book_cpumask(cpu) (&cpu_book_map[cpu]) | ||
36 | |||
37 | int topology_cpu_init(struct cpu *); | 39 | int topology_cpu_init(struct cpu *); |
38 | int topology_set_cpu_management(int fc); | 40 | int topology_set_cpu_management(int fc); |
39 | void topology_schedule_update(void); | 41 | void topology_schedule_update(void); |