[tip: sched/core] sched/smp: Use the SMP version of schedstats

tip-bot2 for Ingo Molnar posted 1 patch 3 months, 4 weeks ago
kernel/sched/stats.c | 4 ----
1 file changed, 4 deletions(-)
[tip: sched/core] sched/smp: Use the SMP version of schedstats
Posted by tip-bot2 for Ingo Molnar 3 months, 4 weeks ago
The following commit has been merged into the sched/core branch of tip:

Commit-ID:     9d9af2372f2a46242fd5e827973235f40f31a706
Gitweb:        https://git.kernel.org/tip/9d9af2372f2a46242fd5e827973235f40f31a706
Author:        Ingo Molnar <mingo@kernel.org>
AuthorDate:    Wed, 28 May 2025 10:09:12 +02:00
Committer:     Ingo Molnar <mingo@kernel.org>
CommitterDate: Fri, 13 Jun 2025 08:47:21 +02:00

sched/smp: Use the SMP version of schedstats

Simplify the scheduler by making CONFIG_SMP=y schedstats
debugging output unconditional.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>
Cc: Juri Lelli <juri.lelli@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Shrikanth Hegde <sshegde@linux.ibm.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Valentin Schneider <vschneid@redhat.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
Link: https://lore.kernel.org/r/20250528080924.2273858-32-mingo@kernel.org
---
 kernel/sched/stats.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/kernel/sched/stats.c b/kernel/sched/stats.c
index 86acd37..d1c9429 100644
--- a/kernel/sched/stats.c
+++ b/kernel/sched/stats.c
@@ -115,10 +115,8 @@ static int show_schedstat(struct seq_file *seq, void *v)
 		seq_printf(seq, "timestamp %lu\n", jiffies);
 	} else {
 		struct rq *rq;
-#ifdef CONFIG_SMP
 		struct sched_domain *sd;
 		int dcount = 0;
-#endif
 		cpu = (unsigned long)(v - 2);
 		rq = cpu_rq(cpu);
 
@@ -133,7 +131,6 @@ static int show_schedstat(struct seq_file *seq, void *v)
 
 		seq_printf(seq, "\n");
 
-#ifdef CONFIG_SMP
 		/* domain-specific stats */
 		rcu_read_lock();
 		for_each_domain(cpu, sd) {
@@ -164,7 +161,6 @@ static int show_schedstat(struct seq_file *seq, void *v)
 			    sd->ttwu_move_balance);
 		}
 		rcu_read_unlock();
-#endif /* CONFIG_SMP */
 	}
 	return 0;
 }