]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
sched: Move sched domain name out of CONFIG_SCHED_DEBUG
authorSwapnil Sapkal <swapnil.sapkal@amd.com>
Fri, 20 Dec 2024 06:32:22 +0000 (06:32 +0000)
committerPeter Zijlstra <peterz@infradead.org>
Fri, 20 Dec 2024 14:31:17 +0000 (15:31 +0100)
/proc/schedstat file shows cpu and sched domain level scheduler
statistics. It does not show domain name instead shows domain level.
It will be very useful for tools like `perf sched stats`[1] to
aggragate domain level stats if domain names are shown in /proc/schedstat.
But sched domain name is guarded by CONFIG_SCHED_DEBUG. As per the
discussion[2], move sched domain name out of CONFIG_SCHED_DEBUG.

[1] https://lore.kernel.org/lkml/20241122084452.1064968-1-swapnil.sapkal@amd.com/
[2] https://lore.kernel.org/lkml/fcefeb4d-3acb-462d-9c9b-3df8d927e522@amd.com/

Suggested-by: "Gautham R. Shenoy" <gautham.shenoy@amd.com>
Signed-off-by: Swapnil Sapkal <swapnil.sapkal@amd.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20241220063224.17767-5-swapnil.sapkal@amd.com
include/linux/sched/topology.h
kernel/sched/topology.c

index 76a662e1ec243bbda00a6e3381cbb40d31bedfda..7f3dbafe18177c0680b5b503e6d3b5b524d3592f 100644 (file)
@@ -143,9 +143,7 @@ struct sched_domain {
        unsigned int ttwu_move_affine;
        unsigned int ttwu_move_balance;
 #endif
-#ifdef CONFIG_SCHED_DEBUG
        char *name;
-#endif
        union {
                void *private;          /* used during construction */
                struct rcu_head rcu;    /* used during destruction */
@@ -201,18 +199,12 @@ struct sched_domain_topology_level {
        int                 flags;
        int                 numa_level;
        struct sd_data      data;
-#ifdef CONFIG_SCHED_DEBUG
        char                *name;
-#endif
 };
 
 extern void __init set_sched_topology(struct sched_domain_topology_level *tl);
 
-#ifdef CONFIG_SCHED_DEBUG
 # define SD_INIT_NAME(type)            .name = #type
-#else
-# define SD_INIT_NAME(type)
-#endif
 
 #else /* CONFIG_SMP */
 
index 9c405f0e7b26d9f5d4d5fcd9c6539a399ec77d25..da33ec9e94ab2de9d9855d1a77adfc26a049ac0f 100644 (file)
@@ -1635,9 +1635,7 @@ sd_init(struct sched_domain_topology_level *tl,
                .max_newidle_lb_cost    = 0,
                .last_decay_max_lb_cost = jiffies,
                .child                  = child,
-#ifdef CONFIG_SCHED_DEBUG
                .name                   = tl->name,
-#endif
        };
 
        sd_span = sched_domain_span(sd);
@@ -2338,10 +2336,8 @@ static struct sched_domain *build_sched_domain(struct sched_domain_topology_leve
                if (!cpumask_subset(sched_domain_span(child),
                                    sched_domain_span(sd))) {
                        pr_err("BUG: arch topology borken\n");
-#ifdef CONFIG_SCHED_DEBUG
                        pr_err("     the %s domain not a subset of the %s domain\n",
                                        child->name, sd->name);
-#endif
                        /* Fixup, ensure @sd has at least @child CPUs. */
                        cpumask_or(sched_domain_span(sd),
                                   sched_domain_span(sd),