summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Redpath <chris.redpath@arm.com>2017-06-03 15:03:03 +0100
committerChris Redpath <chris.redpath@arm.com>2017-06-03 15:03:03 +0100
commitfce0ecf04a7e0b6f912151607758eb2e98888569 (patch)
treed200c2f1623ddc6d84239bfff7c61d910b8189ee
parent57e54f412025c46954ae82d67e99f899d9882043 (diff)
schedstats/eas: guard properly to avoid breaking non-smp schedstats users
Add appropriate #ifdef guards to ensure the smp-only easstats structs are not used when smp is not enabled. Arnd got a report from buildbot, analysed it, and pointed out exactly what the issue was. Reported-by: "Arnd Bergmann" <arnd@arndb.de> Suggested-by: "Arnd Bergmann" <arnd@arndb.de> Fixes: 4b85765a3dd9 ("sched/fair: Add eas (& cas) specific rq, sd and task stats") Signed-off-by: Chris Redpath <chris.redpath@arm.com> Change-Id: I60554dea20137f6774db3f59b4afd40a06554cfc
-rw-r--r--kernel/sched/sched.h3
-rw-r--r--kernel/sched/stats.c5
2 files changed, 6 insertions, 2 deletions
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 6880fbc39760..ce364ddbb72c 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -734,9 +734,10 @@ struct rq {
/* try_to_wake_up() stats */
unsigned int ttwu_count;
unsigned int ttwu_local;
-
+#ifdef CONFIG_SMP
struct eas_stats eas_stats;
#endif
+#endif
#ifdef CONFIG_SMP
struct llist_head wake_list;
diff --git a/kernel/sched/stats.c b/kernel/sched/stats.c
index b63879918cd6..6d74a7c77c8c 100644
--- a/kernel/sched/stats.c
+++ b/kernel/sched/stats.c
@@ -12,6 +12,7 @@
*/
#define SCHEDSTAT_VERSION 15
+#ifdef CONFIG_SMP
static inline void show_easstat(struct seq_file *seq, struct eas_stats *stats)
{
/* eas-specific runqueue stats */
@@ -31,6 +32,7 @@ static inline void show_easstat(struct seq_file *seq, struct eas_stats *stats)
seq_printf(seq, "%llu %llu\n",
stats->cas_attempts, stats->cas_count);
}
+#endif
static int show_schedstat(struct seq_file *seq, void *v)
{
@@ -59,8 +61,9 @@ static int show_schedstat(struct seq_file *seq, void *v)
seq_printf(seq, "\n");
- show_easstat(seq, &rq->eas_stats);
#ifdef CONFIG_SMP
+ show_easstat(seq, &rq->eas_stats);
+
/* domain-specific stats */
rcu_read_lock();
for_each_domain(cpu, sd) {