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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1445373372-6567-9-git-send-email-cmetcalf@ezchip.com>
Date:	Tue, 20 Oct 2015 16:36:06 -0400
From:	Chris Metcalf <cmetcalf@...hip.com>
To:	Gilad Ben Yossef <giladb@...hip.com>,
	Steven Rostedt <rostedt@...dmis.org>,
	Ingo Molnar <mingo@...nel.org>,
	Peter Zijlstra <peterz@...radead.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	"Rik van Riel" <riel@...hat.com>, Tejun Heo <tj@...nel.org>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
	Christoph Lameter <cl@...ux.com>,
	Viresh Kumar <viresh.kumar@...aro.org>,
	Catalin Marinas <catalin.marinas@....com>,
	Will Deacon <will.deacon@....com>,
	Andy Lutomirski <luto@...capital.net>,
	<linux-doc@...r.kernel.org>, <linux-kernel@...r.kernel.org>
CC:	Chris Metcalf <cmetcalf@...hip.com>
Subject: [PATCH v8 08/14] nohz_full: allow disabling the 1Hz minimum tick at boot

While the current fallback to 1-second tick is still required for
a number of kernel accounting tasks (e.g. vruntime, load balancing
data, and load accounting), it's useful to be able to disable it
for testing purposes.  Paul McKenney observed that if we provide
a mode where the 1Hz fallback timer is removed, this will provide
an environment where new code that relies on that tick will get
punished, and we won't forgive such assumptions silently.

This option also allows easy testing of nohz_full and task-isolation
modes to determine what functionality needs to be implemented,
and what possibly-spurious timer interrupts are scheduled when
the basic 1Hz tick has been turned off.

Signed-off-by: Chris Metcalf <cmetcalf@...hip.com>
---
 kernel/sched/core.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index b79f8e0aeffb..634d5c2ab08a 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -2849,6 +2849,19 @@ void scheduler_tick(void)
 }
 
 #ifdef CONFIG_NO_HZ_FULL
+/*
+ * Allow a boot-time option to debug running
+ * without the 1Hz minimum tick on nohz_full cores.
+ */
+static bool debug_1hz_tick;
+
+static __init int set_debug_1hz_tick(char *arg)
+{
+	debug_1hz_tick = true;
+	return 1;
+}
+__setup("debug_1hz_tick", set_debug_1hz_tick);
+
 /**
  * scheduler_tick_max_deferment
  *
@@ -2867,6 +2880,9 @@ u64 scheduler_tick_max_deferment(void)
 	struct rq *rq = this_rq();
 	unsigned long next, now = READ_ONCE(jiffies);
 
+	if (debug_1hz_tick)
+		return KTIME_MAX;
+
 	next = rq->last_sched_tick + HZ;
 
 	if (time_before_eq(next, now))
-- 
2.1.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ