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]
Message-Id: <1465918082-27005-2-git-send-email-fweisbec@gmail.com>
Date:	Tue, 14 Jun 2016 17:28:00 +0200
From:	Frederic Weisbecker <fweisbec@...il.com>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Ingo Molnar <mingo@...nel.org>, Mike Galbraith <efault@....de>,
	Thomas Gleixner <tglx@...utronix.de>
Subject: [PATCH 1/3] sched: Introduce sched_time_avg_ns minimal value

Writing 0 to sysctl value "kernel.sched_time_avg_ms" triggers a lockup:

	NMI watchdog: Watchdog detected hard LOCKUP on cpu 4
	Modules linked in:
	irq event stamp: 81894
	hardirqs last  enabled at (81893): [<ffffffff8111af88>] rcu_idle_exit+0x68/0xa0
	hardirqs last disabled at (81894): [<ffffffff8113536e>] tick_nohz_idle_exit+0x2e/0x110
	softirqs last  enabled at (81870): [<ffffffff810ab8a1>] _local_bh_enable+0x21/0x50
	softirqs last disabled at (81869): [<ffffffff810ace2b>] irq_enter+0x4b/0x70
	CPU: 4 PID: 0 Comm: swapper/4 Not tainted 4.6.0-rc4+ #269
	Hardware name: MSI MS-7850/Z87-G41 PC Mate(MS-7850), BIOS V1.3 08/18/2013
	0000000000000000 ffff88021fb05b80 ffffffff8141b023 0000000000000000
	0000000000000004 ffff88021fb05ba0 ffffffff81163fcf 0000000000000000
	ffff88021fb05c40 ffff88021fb05be0 ffffffff8119ae7c 00000001810077ce
	Call Trace:
	<NMI>  [<ffffffff8141b023>] dump_stack+0x85/0xc2
	[<ffffffff81163fcf>] watchdog_overflow_callback+0x13f/0x160
	[<ffffffff8119ae7c>] __perf_event_overflow+0x9c/0x1f0
	[<ffffffff8119baa4>] perf_event_overflow+0x14/0x20
	[<ffffffff8100d235>] intel_pmu_handle_irq+0x1d5/0x4a0
	[<ffffffff810062ad>] perf_event_nmi_handler+0x2d/0x50
	[<ffffffff81174397>] ? tracing_generic_entry_update+0x97/0xb0
	[<ffffffff81039cef>] nmi_handle+0xbf/0x2f0
	[<ffffffff81039c35>] ? nmi_handle+0x5/0x2f0
	[<ffffffff81174397>] ? tracing_generic_entry_update+0x97/0xb0
	[<ffffffff8103a171>] default_do_nmi+0x71/0x1b0
	[<ffffffff8103a3c5>] do_nmi+0x115/0x170
	[<ffffffff8194b511>] end_repeat_nmi+0x1a/0x1e
	[<ffffffff81174397>] ? tracing_generic_entry_update+0x97/0xb0
	[<ffffffff81174397>] ? tracing_generic_entry_update+0x97/0xb0
	[<ffffffff81174397>] ? tracing_generic_entry_update+0x97/0xb0
	<<EOE>>  [<ffffffff81177d3f>] ? trace_buffer_lock_reserve+0x3f/0x60
	[<ffffffff810d3d51>] ? sched_avg_update+0x51/0xc0
	[<ffffffff811781e5>] __trace_bputs+0x75/0x100
	[<ffffffff810d3d79>] sched_avg_update+0x79/0xc0
	[<ffffffff810dedc3>] cpu_load_update+0xa3/0xd0
	[<ffffffff810e694a>] cpu_load_update_nohz_stop+0x7a/0x80
	[<ffffffff811353b7>] tick_nohz_idle_exit+0x77/0x110
	[<ffffffff810f0866>] cpu_startup_entry+0x176/0x420
	[<ffffffff810589f4>] start_secondary+0x104/0x110

This is due to the loop in sched_avg_update() that fails to make any
progress when the update delay is 0.

Since this is non-sense to set that value to 0 anyway, force a minimum
of at least 1 millisecond.

Cc: Mike Galbraith <efault@....de>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Ingo Molnar <mingo@...nel.org>
Signed-off-by: Frederic Weisbecker <fweisbec@...il.com>
---
 kernel/sysctl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 87b2fc3..b730dd6 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -345,7 +345,8 @@ static struct ctl_table kern_table[] = {
 		.data		= &sysctl_sched_time_avg,
 		.maxlen		= sizeof(unsigned int),
 		.mode		= 0644,
-		.proc_handler	= proc_dointvec,
+		.proc_handler	= proc_dointvec_minmax,
+		.extra1		= &one,
 	},
 	{
 		.procname	= "sched_shares_window_ns",
-- 
2.7.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ