@@ -2784,9 +2784,18 @@ typedef const struct cpumask *(*sched_domain_mask_f)(int cpu);
struct sched_domain_topology_info {
sched_domain_mask_f mask;
- int flags;
+ int flags;
+#ifdef CONFIG_SCHED_DEBUG
+ char *name;
+#endif
};
+#ifdef CONFIG_SCHED_DEBUG
+# define SD_NAME(n) .name = #n
+#else
+# define SD_NAME(n)
+#endif
+
extern void
set_sd_topology_info(struct sched_domain_topology_info *ti, unsigned int s);
@@ -5243,12 +5243,6 @@ int __weak arch_sd_sibling_asym_packing(void)
* Non-inlined to reduce accumulated stack pressure in build_sched_domains()
*/
-#ifdef CONFIG_SCHED_DEBUG
-# define SD_INIT_NAME(sd, type) sd->name = #type
-#else
-# define SD_INIT_NAME(sd, type) do { } while (0)
-#endif
-
static int default_relax_domain_level = -1;
int sched_domain_level_max;
@@ -5341,15 +5335,15 @@ static void claim_allocations(int cpu, struct sched_domain *sd)
*/
static struct sched_domain_topology_info default_topology_info[] = {
#ifdef CONFIG_SCHED_SMT
- { cpu_smt_mask, SD_SHARE_CPUPOWER | SD_SHARE_PKG_RESOURCES },
+ { cpu_smt_mask, SD_SHARE_CPUPOWER | SD_SHARE_PKG_RESOURCES, SD_NAME(SIBLING) },
#endif
#ifdef CONFIG_SCHED_MC
- { cpu_coregroup_mask, SD_SHARE_PKG_RESOURCES },
+ { cpu_coregroup_mask, SD_SHARE_PKG_RESOURCES, SD_NAME(MC) },
#endif
#ifdef CONFIG_SCHED_BOOK
- { cpu_book_mask, },
+ { cpu_book_mask, SD_NAME(BOOK) },
#endif
- { cpu_cpu_mask, },
+ { cpu_cpu_mask, SD_NAME(CPU) },
};
static struct sched_domain_topology_level *sched_domain_topology;
@@ -5676,6 +5670,9 @@ sd_init(struct sched_domain_topology_level *tl, int cpu)
.last_balance = jiffies,
.balance_interval = sd_weight,
+#ifdef CONFIG_SCHED_DEBUG
+ .name = tl->info.name,
+#endif
};
/*
@@ -5693,13 +5690,9 @@ sd_init(struct sched_domain_topology_level *tl, int cpu)
* setup.
*/
sd->flags |= arch_sd_sibling_asym_packing();
-
- SD_INIT_NAME(sd, SMT);
} else if (sd->flags & SD_SHARE_PKG_RESOURCES) {
sd->cache_nice_tries = 1;
sd->busy_idx = 2;
-
- SD_INIT_NAME(sd, MC);
#ifdef CONFIG_NUMA
} else if (sd->flags & SD_NUMA) {
sd->busy_factor = 32,
@@ -5719,8 +5712,6 @@ sd_init(struct sched_domain_topology_level *tl, int cpu)
sd->busy_idx = 2;
sd->idle_idx = 1;
sd->flags |= SD_PREFER_SIBLING;
-
- SD_INIT_NAME(sd, CPU);
}
sd->private = &tl->data;