diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2011-12-27 05:27:09 -0500 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2011-12-27 05:27:10 -0500 |
commit | 83a24e32908476c33ea9abc132c73020e2cd3620 (patch) | |
tree | cd1857a48ce2995dc5d2ab6c0950622120137bb4 /arch/s390/include | |
parent | 3931723f36165e137c67b8c62346024a6c4f223d (diff) |
[S390] topology: get rid of ifdefs
Remove all ifdefs from topology code and also only compile it for the
CONFIG_SCHED_BOOK case. The new code selects SCHED_MC if SCHED_BOOK is
selected. SCHED_MC without SCHED_BOOK is not possible anymore.
Furthermore various sysfs attributes are not available anymore for the
!SCHED_BOOK case. In particular all attributes that correspond to
CPU polarization.
But since all real world kernels have SCHED_BOOK selected anyway this
doesn't matter too much.
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/smp.h | 1 | ||||
-rw-r--r-- | arch/s390/include/asm/topology.h | 38 |
2 files changed, 32 insertions, 7 deletions
diff --git a/arch/s390/include/asm/smp.h b/arch/s390/include/asm/smp.h index ab47a69fdf07..c32e9123b40c 100644 --- a/arch/s390/include/asm/smp.h +++ b/arch/s390/include/asm/smp.h | |||
@@ -23,7 +23,6 @@ extern void __cpu_die (unsigned int cpu); | |||
23 | extern int __cpu_up (unsigned int cpu); | 23 | extern int __cpu_up (unsigned int cpu); |
24 | 24 | ||
25 | extern struct mutex smp_cpu_state_mutex; | 25 | extern struct mutex smp_cpu_state_mutex; |
26 | extern int smp_cpu_polarization[]; | ||
27 | 26 | ||
28 | extern void arch_send_call_function_single_ipi(int cpu); | 27 | extern void arch_send_call_function_single_ipi(int cpu); |
29 | extern void arch_send_call_function_ipi_mask(const struct cpumask *mask); | 28 | extern void arch_send_call_function_ipi_mask(const struct cpumask *mask); |
diff --git a/arch/s390/include/asm/topology.h b/arch/s390/include/asm/topology.h index 005d77d8ae2a..7016dd7b6bc4 100644 --- a/arch/s390/include/asm/topology.h +++ b/arch/s390/include/asm/topology.h | |||
@@ -4,6 +4,10 @@ | |||
4 | #include <linux/cpumask.h> | 4 | #include <linux/cpumask.h> |
5 | #include <asm/sysinfo.h> | 5 | #include <asm/sysinfo.h> |
6 | 6 | ||
7 | struct cpu; | ||
8 | |||
9 | #ifdef CONFIG_SCHED_BOOK | ||
10 | |||
7 | extern unsigned char cpu_core_id[NR_CPUS]; | 11 | extern unsigned char cpu_core_id[NR_CPUS]; |
8 | extern cpumask_t cpu_core_map[NR_CPUS]; | 12 | extern cpumask_t cpu_core_map[NR_CPUS]; |
9 | 13 | ||
@@ -16,8 +20,6 @@ static inline const struct cpumask *cpu_coregroup_mask(int cpu) | |||
16 | #define topology_core_cpumask(cpu) (&cpu_core_map[cpu]) | 20 | #define topology_core_cpumask(cpu) (&cpu_core_map[cpu]) |
17 | #define mc_capable() (1) | 21 | #define mc_capable() (1) |
18 | 22 | ||
19 | #ifdef CONFIG_SCHED_BOOK | ||
20 | |||
21 | extern unsigned char cpu_book_id[NR_CPUS]; | 23 | extern unsigned char cpu_book_id[NR_CPUS]; |
22 | extern cpumask_t cpu_book_map[NR_CPUS]; | 24 | extern cpumask_t cpu_book_map[NR_CPUS]; |
23 | 25 | ||
@@ -29,19 +31,43 @@ static inline const struct cpumask *cpu_book_mask(int cpu) | |||
29 | #define topology_book_id(cpu) (cpu_book_id[cpu]) | 31 | #define topology_book_id(cpu) (cpu_book_id[cpu]) |
30 | #define topology_book_cpumask(cpu) (&cpu_book_map[cpu]) | 32 | #define topology_book_cpumask(cpu) (&cpu_book_map[cpu]) |
31 | 33 | ||
32 | #endif /* CONFIG_SCHED_BOOK */ | 34 | int topology_cpu_init(struct cpu *); |
33 | |||
34 | int topology_set_cpu_management(int fc); | 35 | int topology_set_cpu_management(int fc); |
35 | void topology_schedule_update(void); | 36 | void topology_schedule_update(void); |
36 | void store_topology(struct sysinfo_15_1_x *info); | 37 | void store_topology(struct sysinfo_15_1_x *info); |
37 | 38 | ||
38 | #define POLARIZATION_UNKNWN (-1) | 39 | #else /* CONFIG_SCHED_BOOK */ |
40 | |||
41 | static inline void topology_schedule_update(void) { } | ||
42 | static inline int topology_cpu_init(struct cpu *cpu) { return 0; } | ||
43 | |||
44 | #endif /* CONFIG_SCHED_BOOK */ | ||
45 | |||
46 | #define POLARIZATION_UNKNOWN (-1) | ||
39 | #define POLARIZATION_HRZ (0) | 47 | #define POLARIZATION_HRZ (0) |
40 | #define POLARIZATION_VL (1) | 48 | #define POLARIZATION_VL (1) |
41 | #define POLARIZATION_VM (2) | 49 | #define POLARIZATION_VM (2) |
42 | #define POLARIZATION_VH (3) | 50 | #define POLARIZATION_VH (3) |
43 | 51 | ||
44 | #ifdef CONFIG_SMP | 52 | extern int cpu_polarization[]; |
53 | |||
54 | static inline void cpu_set_polarization(int cpu, int val) | ||
55 | { | ||
56 | #ifdef CONFIG_SCHED_BOOK | ||
57 | cpu_polarization[cpu] = val; | ||
58 | #endif | ||
59 | } | ||
60 | |||
61 | static inline int cpu_read_polarization(int cpu) | ||
62 | { | ||
63 | #ifdef CONFIG_SCHED_BOOK | ||
64 | return cpu_polarization[cpu]; | ||
65 | #else | ||
66 | return POLARIZATION_HRZ; | ||
67 | #endif | ||
68 | } | ||
69 | |||
70 | #ifdef CONFIG_SCHED_BOOK | ||
45 | void s390_init_cpu_topology(void); | 71 | void s390_init_cpu_topology(void); |
46 | #else | 72 | #else |
47 | static inline void s390_init_cpu_topology(void) | 73 | static inline void s390_init_cpu_topology(void) |