diff options
author | Vincent Guittot <vincent.guittot@linaro.org> | 2014-04-11 05:44:38 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2014-05-07 07:33:50 -0400 |
commit | 2dfd747629e65f89d2dbceb92fffc763f66228b2 (patch) | |
tree | 3a5cc344ebdc42127e80c797c8be822d5a5a6eb6 | |
parent | 143e1e28cb40bed836b0a06567208bd7347c9672 (diff) |
sched, s390: Create a dedicated topology table
BOOK level is only relevant for s390 so we create a dedicated topology table
with BOOK level and remove it from default table.
Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Philipp Hachtmann <phacht@linux.vnet.ibm.com>
Cc: cmetcalf@tilera.com
Cc: benh@kernel.crashing.org
Cc: dietmar.eggemann@arm.com
Cc: preeti@linux.vnet.ibm.com
Cc: tony.luck@intel.com
Cc: fenghua.yu@intel.com
Cc: linux390@de.ibm.com
Cc: linux-s390@vger.kernel.org
Link: http://lkml.kernel.org/r/1397209481-28542-3-git-send-email-vincent.guittot@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r-- | arch/s390/include/asm/topology.h | 11 | ||||
-rw-r--r-- | arch/s390/kernel/topology.c | 20 | ||||
-rw-r--r-- | kernel/sched/core.c | 3 |
3 files changed, 21 insertions, 13 deletions
diff --git a/arch/s390/include/asm/topology.h b/arch/s390/include/asm/topology.h index 07763bdb408d..56af53093d24 100644 --- a/arch/s390/include/asm/topology.h +++ b/arch/s390/include/asm/topology.h | |||
@@ -26,21 +26,12 @@ extern struct cpu_topology_s390 cpu_topology[NR_CPUS]; | |||
26 | 26 | ||
27 | #define mc_capable() 1 | 27 | #define mc_capable() 1 |
28 | 28 | ||
29 | static inline const struct cpumask *cpu_coregroup_mask(int cpu) | ||
30 | { | ||
31 | return &cpu_topology[cpu].core_mask; | ||
32 | } | ||
33 | |||
34 | static inline const struct cpumask *cpu_book_mask(int cpu) | ||
35 | { | ||
36 | return &cpu_topology[cpu].book_mask; | ||
37 | } | ||
38 | |||
39 | int topology_cpu_init(struct cpu *); | 29 | int topology_cpu_init(struct cpu *); |
40 | int topology_set_cpu_management(int fc); | 30 | int topology_set_cpu_management(int fc); |
41 | void topology_schedule_update(void); | 31 | void topology_schedule_update(void); |
42 | void store_topology(struct sysinfo_15_1_x *info); | 32 | void store_topology(struct sysinfo_15_1_x *info); |
43 | void topology_expect_change(void); | 33 | void topology_expect_change(void); |
34 | const struct cpumask *cpu_coregroup_mask(int cpu); | ||
44 | 35 | ||
45 | #else /* CONFIG_SCHED_BOOK */ | 36 | #else /* CONFIG_SCHED_BOOK */ |
46 | 37 | ||
diff --git a/arch/s390/kernel/topology.c b/arch/s390/kernel/topology.c index 6298fed11ced..1860ad3cbc04 100644 --- a/arch/s390/kernel/topology.c +++ b/arch/s390/kernel/topology.c | |||
@@ -443,6 +443,23 @@ int topology_cpu_init(struct cpu *cpu) | |||
443 | return sysfs_create_group(&cpu->dev.kobj, &topology_cpu_attr_group); | 443 | return sysfs_create_group(&cpu->dev.kobj, &topology_cpu_attr_group); |
444 | } | 444 | } |
445 | 445 | ||
446 | const struct cpumask *cpu_coregroup_mask(int cpu) | ||
447 | { | ||
448 | return &cpu_topology[cpu].core_mask; | ||
449 | } | ||
450 | |||
451 | static const struct cpumask *cpu_book_mask(int cpu) | ||
452 | { | ||
453 | return &cpu_topology[cpu].book_mask; | ||
454 | } | ||
455 | |||
456 | static struct sched_domain_topology_level s390_topology[] = { | ||
457 | { cpu_coregroup_mask, cpu_core_flags, SD_INIT_NAME(MC) }, | ||
458 | { cpu_book_mask, SD_INIT_NAME(BOOK) }, | ||
459 | { cpu_cpu_mask, SD_INIT_NAME(DIE) }, | ||
460 | { NULL, }, | ||
461 | }; | ||
462 | |||
446 | static int __init topology_init(void) | 463 | static int __init topology_init(void) |
447 | { | 464 | { |
448 | if (!MACHINE_HAS_TOPOLOGY) { | 465 | if (!MACHINE_HAS_TOPOLOGY) { |
@@ -451,6 +468,9 @@ static int __init topology_init(void) | |||
451 | } | 468 | } |
452 | set_topology_timer(); | 469 | set_topology_timer(); |
453 | out: | 470 | out: |
471 | |||
472 | set_sched_topology(s390_topology); | ||
473 | |||
454 | return device_create_file(cpu_subsys.dev_root, &dev_attr_dispatching); | 474 | return device_create_file(cpu_subsys.dev_root, &dev_attr_dispatching); |
455 | } | 475 | } |
456 | device_initcall(topology_init); | 476 | device_initcall(topology_init); |
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 7d332b7899cc..e59e5aec745a 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c | |||
@@ -6024,9 +6024,6 @@ static struct sched_domain_topology_level default_topology[] = { | |||
6024 | #ifdef CONFIG_SCHED_MC | 6024 | #ifdef CONFIG_SCHED_MC |
6025 | { cpu_coregroup_mask, cpu_core_flags, SD_INIT_NAME(MC) }, | 6025 | { cpu_coregroup_mask, cpu_core_flags, SD_INIT_NAME(MC) }, |
6026 | #endif | 6026 | #endif |
6027 | #ifdef CONFIG_SCHED_BOOK | ||
6028 | { cpu_book_mask, SD_INIT_NAME(BOOK) }, | ||
6029 | #endif | ||
6030 | { cpu_cpu_mask, SD_INIT_NAME(DIE) }, | 6027 | { cpu_cpu_mask, SD_INIT_NAME(DIE) }, |
6031 | { NULL, }, | 6028 | { NULL, }, |
6032 | }; | 6029 | }; |