Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1413466

[PATCH 1/3] sched/debug: fix /proc/sched_debug regression

From Josh Poimboeuf <jpoimboe@redhat.com>
Newsgroups linux.kernel
Subject [PATCH 1/3] sched/debug: fix /proc/sched_debug regression
Date 2016-06-03 22:50 +0200
Message-ID <rG4cy-7ZV-13@gated-at.bofh.it> (permalink)
References <rG4cy-7ZV-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Commit cb2517653fcc ("sched/debug: Make schedstats a runtime tunable
that is disabled by default") introduced a bug when CONFIG_SCHEDSTATS is
enabled and the runtime tunable is disabled (which is the default).  The
wait-time, sum-exec, and sum-sleep fields are missing from the
/proc/sched_debug file in the runnable_tasks section.

Fix it by getting rid of the explicit check for CONFIG_SCHEDSTATS.  It's
already implicitly checked by schedstat_enabled() anyway.

Fixes: cb2517653fcc ("sched/debug: Make schedstats a runtime tunable that is disabled by default")
Cc: stable@vger.kernel.org
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
---
 kernel/sched/debug.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c
index cf905f6..500ea7e 100644
--- a/kernel/sched/debug.c
+++ b/kernel/sched/debug.c
@@ -427,19 +427,18 @@ print_task(struct seq_file *m, struct rq *rq, struct task_struct *p)
 		SPLIT_NS(p->se.vruntime),
 		(long long)(p->nvcsw + p->nivcsw),
 		p->prio);
-#ifdef CONFIG_SCHEDSTATS
-	if (schedstat_enabled()) {
+
+	if (schedstat_enabled())
 		SEQ_printf(m, "%9Ld.%06ld %9Ld.%06ld %9Ld.%06ld",
 			SPLIT_NS(p->se.statistics.wait_sum),
 			SPLIT_NS(p->se.sum_exec_runtime),
 			SPLIT_NS(p->se.statistics.sum_sleep_runtime));
-	}
-#else
-	SEQ_printf(m, "%9Ld.%06ld %9Ld.%06ld %9Ld.%06ld",
-		0LL, 0L,
-		SPLIT_NS(p->se.sum_exec_runtime),
-		0LL, 0L);
-#endif
+	else
+		SEQ_printf(m, "%9Ld.%06ld %9Ld.%06ld %9Ld.%06ld",
+			0LL, 0L,
+			SPLIT_NS(p->se.sum_exec_runtime),
+			0LL, 0L);
+
 #ifdef CONFIG_NUMA_BALANCING
 	SEQ_printf(m, " %d %d", task_node(p), task_numa_group_id(p));
 #endif
-- 
2.4.11

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/3] sched/debug: schedstats bug fix and cleanups Josh Poimboeuf <jpoimboe@redhat.com> - 2016-06-03 22:50 +0200
  [PATCH 2/3] sched/debug: always show nr_migrations Josh Poimboeuf <jpoimboe@redhat.com> - 2016-06-03 22:50 +0200
  [PATCH 1/3] sched/debug: fix /proc/sched_debug regression Josh Poimboeuf <jpoimboe@redhat.com> - 2016-06-03 22:50 +0200
  [PATCH 3/3] sched/debug: remove unnecessary CONFIG_SCHEDSTATS checks Josh Poimboeuf <jpoimboe@redhat.com> - 2016-06-03 22:50 +0200
    Re: [PATCH 3/3] sched/debug: remove unnecessary CONFIG_SCHEDSTATS  checks Josh Poimboeuf <jpoimboe@redhat.com> - 2016-06-03 23:20 +0200
  Re: [PATCH 0/3] sched/debug: schedstats bug fix and cleanups Josh Poimboeuf <jpoimboe@redhat.com> - 2016-06-03 23:50 +0200

csiph-web