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


Groups > linux.kernel > #1532532

[tip:x86/timers] x86/tsc: Move sync cleanup to a safe place

From tip-bot for Thomas Gleixner <tipbot@zytor.com>
Newsgroups linux.kernel
Subject [tip:x86/timers] x86/tsc: Move sync cleanup to a safe place
Date 2016-11-29 18:00 +0100
Message-ID <sITV9-2B3-59@gated-at.bofh.it> (permalink)
References <sFelr-5AY-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Commit-ID:  ce68ad5a095f151426cab18cc8fad9c968421da3
Gitweb:     http://git.kernel.org/tip/ce68ad5a095f151426cab18cc8fad9c968421da3
Author:     Thomas Gleixner <tglx@linutronix.de>
AuthorDate: Sat, 19 Nov 2016 13:47:40 +0000
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Tue, 29 Nov 2016 17:29:48 +0100

x86/tsc: Move sync cleanup to a safe place

Cleaning up the stop marker on the control CPU is wrong when we want to add
retry support. Move the cleanup to the starting CPU.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Link: http://lkml.kernel.org/r/20161119134017.892095627@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

---
 arch/x86/kernel/tsc_sync.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/x86/kernel/tsc_sync.c b/arch/x86/kernel/tsc_sync.c
index 1770f60..8642223 100644
--- a/arch/x86/kernel/tsc_sync.c
+++ b/arch/x86/kernel/tsc_sync.c
@@ -267,11 +267,6 @@ void check_tsc_sync_source(int cpu)
 	}
 
 	/*
-	 * Reset it - in case this is a second bootup:
-	 */
-	atomic_set(&stop_count, 0);
-
-	/*
 	 * Wait for the target to start or to skip the test:
 	 */
 	while (atomic_read(&start_count) != cpus - 1) {
@@ -360,6 +355,11 @@ void check_tsc_sync_target(void)
 	 */
 	while (atomic_read(&stop_count) != cpus)
 		cpu_relax();
+
+	/*
+	 * Reset it for the next sync test:
+	 */
+	atomic_set(&stop_count, 0);
 }
 
 #endif /* CONFIG_SMP */

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


Thread

[tip:x86/timers] x86/tsc: Move sync cleanup to a safe place tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2016-11-29 18:00 +0100

csiph-web