aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2011-04-07 08:10:04 -0400
committerIngo Molnar <mingo@elte.hu>2011-04-11 08:09:32 -0400
commit60495e7760d8ee364695006af37309b0755e0e17 (patch)
tree1c842c0797a6a6b0066b18f296661fcf77cd0d0a /kernel
parent54ab4ff4316eb329d2c1acc110fbc623d2966931 (diff)
sched: Dynamic sched_domain::level
Remove the SD_LV_ enum and use dynamic level assignments. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Mike Galbraith <efault@gmx.de> Cc: Nick Piggin <npiggin@kernel.dk> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Andrew Morton <akpm@linux-foundation.org> Link: http://lkml.kernel.org/r/20110407122942.969433965@chello.nl Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/cpuset.c2
-rw-r--r--kernel/sched.c9
2 files changed, 7 insertions, 4 deletions
diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index 33eee16addb8..2bb8c2e98fff 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -1159,7 +1159,7 @@ int current_cpuset_is_being_rebound(void)
1159static int update_relax_domain_level(struct cpuset *cs, s64 val) 1159static int update_relax_domain_level(struct cpuset *cs, s64 val)
1160{ 1160{
1161#ifdef CONFIG_SMP 1161#ifdef CONFIG_SMP
1162 if (val < -1 || val >= SD_LV_MAX) 1162 if (val < -1 || val >= sched_domain_level_max)
1163 return -EINVAL; 1163 return -EINVAL;
1164#endif 1164#endif
1165 1165
diff --git a/kernel/sched.c b/kernel/sched.c
index 3231e1997426..506cb8147c70 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -6966,7 +6966,6 @@ sd_init_##type(struct sched_domain_topology_level *tl, int cpu) \
6966{ \ 6966{ \
6967 struct sched_domain *sd = *per_cpu_ptr(tl->data.sd, cpu); \ 6967 struct sched_domain *sd = *per_cpu_ptr(tl->data.sd, cpu); \
6968 *sd = SD_##type##_INIT; \ 6968 *sd = SD_##type##_INIT; \
6969 sd->level = SD_LV_##type; \
6970 SD_INIT_NAME(sd, type); \ 6969 SD_INIT_NAME(sd, type); \
6971 sd->private = &tl->data; \ 6970 sd->private = &tl->data; \
6972 return sd; \ 6971 return sd; \
@@ -6988,13 +6987,14 @@ SD_INIT_FUNC(CPU)
6988#endif 6987#endif
6989 6988
6990static int default_relax_domain_level = -1; 6989static int default_relax_domain_level = -1;
6990int sched_domain_level_max;
6991 6991
6992static int __init setup_relax_domain_level(char *str) 6992static int __init setup_relax_domain_level(char *str)
6993{ 6993{
6994 unsigned long val; 6994 unsigned long val;
6995 6995
6996 val = simple_strtoul(str, NULL, 0); 6996 val = simple_strtoul(str, NULL, 0);
6997 if (val < SD_LV_MAX) 6997 if (val < sched_domain_level_max)
6998 default_relax_domain_level = val; 6998 default_relax_domain_level = val;
6999 6999
7000 return 1; 7000 return 1;
@@ -7173,8 +7173,11 @@ struct sched_domain *build_sched_domain(struct sched_domain_topology_level *tl,
7173 7173
7174 set_domain_attribute(sd, attr); 7174 set_domain_attribute(sd, attr);
7175 cpumask_and(sched_domain_span(sd), cpu_map, tl->mask(cpu)); 7175 cpumask_and(sched_domain_span(sd), cpu_map, tl->mask(cpu));
7176 if (child) 7176 if (child) {
7177 sd->level = child->level + 1;
7178 sched_domain_level_max = max(sched_domain_level_max, sd->level);
7177 child->parent = sd; 7179 child->parent = sd;
7180 }
7178 sd->child = child; 7181 sd->child = child;
7179 7182
7180 return sd; 7183 return sd;