aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/include
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2011-12-27 05:27:09 -0500
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2011-12-27 05:27:10 -0500
commit83a24e32908476c33ea9abc132c73020e2cd3620 (patch)
treecd1857a48ce2995dc5d2ab6c0950622120137bb4 /arch/s390/include
parent3931723f36165e137c67b8c62346024a6c4f223d (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.h1
-rw-r--r--arch/s390/include/asm/topology.h38
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);
23extern int __cpu_up (unsigned int cpu); 23extern int __cpu_up (unsigned int cpu);
24 24
25extern struct mutex smp_cpu_state_mutex; 25extern struct mutex smp_cpu_state_mutex;
26extern int smp_cpu_polarization[];
27 26
28extern void arch_send_call_function_single_ipi(int cpu); 27extern void arch_send_call_function_single_ipi(int cpu);
29extern void arch_send_call_function_ipi_mask(const struct cpumask *mask); 28extern 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
7struct cpu;
8
9#ifdef CONFIG_SCHED_BOOK
10
7extern unsigned char cpu_core_id[NR_CPUS]; 11extern unsigned char cpu_core_id[NR_CPUS];
8extern cpumask_t cpu_core_map[NR_CPUS]; 12extern 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
21extern unsigned char cpu_book_id[NR_CPUS]; 23extern unsigned char cpu_book_id[NR_CPUS];
22extern cpumask_t cpu_book_map[NR_CPUS]; 24extern 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 */ 34int topology_cpu_init(struct cpu *);
33
34int topology_set_cpu_management(int fc); 35int topology_set_cpu_management(int fc);
35void topology_schedule_update(void); 36void topology_schedule_update(void);
36void store_topology(struct sysinfo_15_1_x *info); 37void store_topology(struct sysinfo_15_1_x *info);
37 38
38#define POLARIZATION_UNKNWN (-1) 39#else /* CONFIG_SCHED_BOOK */
40
41static inline void topology_schedule_update(void) { }
42static 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 52extern int cpu_polarization[];
53
54static inline void cpu_set_polarization(int cpu, int val)
55{
56#ifdef CONFIG_SCHED_BOOK
57 cpu_polarization[cpu] = val;
58#endif
59}
60
61static 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
45void s390_init_cpu_topology(void); 71void s390_init_cpu_topology(void);
46#else 72#else
47static inline void s390_init_cpu_topology(void) 73static inline void s390_init_cpu_topology(void)