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: <1369845580-15273-2-git-send-email-fweisbec@gmail.com>
Date:	Wed, 29 May 2013 18:39:40 +0200
From:	Frederic Weisbecker <fweisbec@...il.com>
To:	Ingo Molnar <mingo@...nel.org>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Jiri Bohac <jbohac@...e.cz>,
	Steven Rostedt <rostedt@...dmis.org>,
	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Peter Zijlstra <peterz@...radead.org>,
	Borislav Petkov <bp@...en8.de>
Subject: [PATCH] nohz: Prevent broadcast source from stealing full dynticks timekeeping duty

The timekeeping duty is currently assigned to the CPU that
handles the tick broadcast clock device by the time it is set in
one shot mode.

The reason for this is not entirely clear as outlined by Jiri
Bohac: https://patchwork.kernel.org/patch/2302951/

One could speculate though that it makes sure only one CPU
is woken up to fixup the timekeeping max deferment. But the
timekeeper can change anytime after the broadcast CPU becomes
idle. So probably we can remove this as in Jiri's patch, but
not late in the -rc's.

The issue we need to deal with now is that the timekeeping duty
must stay handled by the boot CPU in full dynticks mode for now.
Otherwise it prevents secondary CPUs from offlining and this breaks
suspend/shutdown/reboot/...

Long term plan is to make the timekeeper dynamic in full dynticks
as well but for now lets prevent that to happen to avoid breakages.

Reported-by: Steven Rostedt <rostedt@...dmis.org>
Signed-off-by: Frederic Weisbecker <fweisbec@...il.com>
Cc: Jiri Bohac <jbohac@...e.cz>
Cc: Steven Rostedt <rostedt@...dmis.org>
Cc: Paul E. McKenney <paulmck@...ux.vnet.ibm.com>
Cc: Ingo Molnar <mingo@...nel.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Borislav Petkov <bp@...en8.de>
---
 kernel/time/tick-broadcast.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c
index 24938d5..ed3a253 100644
--- a/kernel/time/tick-broadcast.c
+++ b/kernel/time/tick-broadcast.c
@@ -692,9 +692,14 @@ void tick_broadcast_setup_oneshot(struct clock_event_device *bc)
 
 		bc->event_handler = tick_handle_oneshot_broadcast;
 
-		/* Take the do_timer update */
-		if (!tick_nohz_full_cpu(cpu))
-			tick_do_timer_cpu = cpu;
+		/*
+		 * Take the timekeeping duty unless we run in full
+		 * dynticks mode that require the boot CPU to stay
+		 * the timekeeper for now.
+		 */
+#ifndef CONFIG_NO_HZ_FULL
+		tick_do_timer_cpu = cpu;
+#endif
 
 		/*
 		 * We must be careful here. There might be other CPUs
-- 
1.7.5.4

--
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