return to_cpumask(sg->cpumask);
}
-enum sched_domain_level {
- SD_LV_NONE = 0,
-#ifdef CONFIG_SCHED_SMT
- SD_LV_SIBLING,
-#endif
-#ifdef CONFIG_SCHED_MC
- SD_LV_MC,
-#endif
-#ifdef CONFIG_SCHED_BOOK
- SD_LV_BOOK,
-#endif
- SD_LV_CPU,
-#ifdef CONFIG_NUMA
- SD_LV_NODE,
- SD_LV_ALLNODES,
-#endif
- SD_LV_MAX
-};
-
struct sched_domain_attr {
int relax_domain_level;
};
.relax_domain_level = -1, \
}
+extern int sched_domain_level_max;
+
struct sched_domain {
/* These fields must be setup */
struct sched_domain *parent; /* top domain must be null terminated */
unsigned int forkexec_idx;
unsigned int smt_gain;
int flags; /* See SD_* */
- enum sched_domain_level level;
+ int level;
/* Runtime fields. */
unsigned long last_balance; /* init to jiffies. units in jiffies */
static int update_relax_domain_level(struct cpuset *cs, s64 val)
{
#ifdef CONFIG_SMP
- if (val < -1 || val >= SD_LV_MAX)
+ if (val < -1 || val >= sched_domain_level_max)
return -EINVAL;
#endif
{ \
struct sched_domain *sd = *per_cpu_ptr(tl->data.sd, cpu); \
*sd = SD_##type##_INIT; \
- sd->level = SD_LV_##type; \
SD_INIT_NAME(sd, type); \
sd->private = &tl->data; \
return sd; \
#endif
static int default_relax_domain_level = -1;
+int sched_domain_level_max;
static int __init setup_relax_domain_level(char *str)
{
unsigned long val;
val = simple_strtoul(str, NULL, 0);
- if (val < SD_LV_MAX)
+ if (val < sched_domain_level_max)
default_relax_domain_level = val;
return 1;
set_domain_attribute(sd, attr);
cpumask_and(sched_domain_span(sd), cpu_map, tl->mask(cpu));
- if (child)
+ if (child) {
+ sd->level = child->level + 1;
+ sched_domain_level_max = max(sched_domain_level_max, sd->level);
child->parent = sd;
+ }
sd->child = child;
return sd;