lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri,  3 Jun 2016 15:44:39 -0500
From:	Josh Poimboeuf <jpoimboe@...hat.com>
To:	Ingo Molnar <mingo@...hat.com>,
	Peter Zijlstra <peterz@...radead.org>
Cc:	linux-kernel@...r.kernel.org,
	Mel Gorman <mgorman@...hsingularity.net>,
	Matt Fleming <matt@...eblueprint.co.uk>,
	Srikar Dronamraju <srikar@...ux.vnet.ibm.com>
Subject: [PATCH 1/3] sched/debug: fix /proc/sched_debug regression

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@...r.kernel.org
Signed-off-by: Josh Poimboeuf <jpoimboe@...hat.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ