aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2008-03-12 13:31:59 -0400
committerIngo Molnar <mingo@elte.hu>2008-03-21 11:43:48 -0400
commit22e52b072dd87faa9b2559fe89d4e8f2370f81ca (patch)
tree79e71d0aad3c9ea9f326977c3a3ff1dceaec81b5
parent9aefd0abd8610e8f3bb097debf3afb73f8b7b210 (diff)
sched: add arch_update_cpu_topology hook.
Will be called each time the scheduling domains are rebuild. Needed for architectures that don't have a static cpu topology. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--include/linux/topology.h2
-rw-r--r--kernel/sched.c5
2 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/topology.h b/include/linux/topology.h
index 2d8dac8799cf..bd14f8b30f09 100644
--- a/include/linux/topology.h
+++ b/include/linux/topology.h
@@ -50,6 +50,8 @@
50 for_each_online_node(node) \ 50 for_each_online_node(node) \
51 if (nr_cpus_node(node)) 51 if (nr_cpus_node(node))
52 52
53void arch_update_cpu_topology(void);
54
53/* Conform to ACPI 2.0 SLIT distance definitions */ 55/* Conform to ACPI 2.0 SLIT distance definitions */
54#define LOCAL_DISTANCE 10 56#define LOCAL_DISTANCE 10
55#define REMOTE_DISTANCE 20 57#define REMOTE_DISTANCE 20
diff --git a/kernel/sched.c b/kernel/sched.c
index 78482e51b583..28c73f07efb2 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -6807,6 +6807,10 @@ static int ndoms_cur; /* number of sched domains in 'doms_cur' */
6807 */ 6807 */
6808static cpumask_t fallback_doms; 6808static cpumask_t fallback_doms;
6809 6809
6810void __attribute__((weak)) arch_update_cpu_topology(void)
6811{
6812}
6813
6810/* 6814/*
6811 * Set up scheduler domains and groups. Callers must hold the hotplug lock. 6815 * Set up scheduler domains and groups. Callers must hold the hotplug lock.
6812 * For now this just excludes isolated cpus, but could be used to 6816 * For now this just excludes isolated cpus, but could be used to
@@ -6816,6 +6820,7 @@ static int arch_init_sched_domains(const cpumask_t *cpu_map)
6816{ 6820{
6817 int err; 6821 int err;
6818 6822
6823 arch_update_cpu_topology();
6819 ndoms_cur = 1; 6824 ndoms_cur = 1;
6820 doms_cur = kmalloc(sizeof(cpumask_t), GFP_KERNEL); 6825 doms_cur = kmalloc(sizeof(cpumask_t), GFP_KERNEL);
6821 if (!doms_cur) 6826 if (!doms_cur)